unzipWith
Creates an array of elements, ungrouping the elements in an array produced by zip and applying the provided function.
- Use
Math.max(),Function.prototype.apply()to get the longest subarray in the array,Array.prototype.map()to make each element an array. - Use
Array.prototype.reduce()andArray.prototype.forEach()to map grouped values to individual arrays. - Use
Array.prototype.map()and the spread operator (...) to applyfnto each individual group of elements.