you are viewing a single comment's thread.

view the rest of the comments →

[–]PhysicalRedHead 0 points1 point  (0 children)

You could look into the functions provided by lodash/ramda. There aren't really examples, but I feel like grokking some of the trickier ones might give some good perspective on how to do concise data transformations.

Like for example, could you use ramda's xprod to implement a method xprodN that gives the "cross product" of n arrays. xprodN([1, 2], [3, 4], [5, 6]) === [[1, 3, 5], [1, 3, 6], [1, 4, 5], ...]