1×
Become a member
to unlock all features
Autoplay

    Learn to Flatten and Flatmap Arrays with Reduce

    javascriptJavaScript

    Learn a few advanced reduction patterns: flatten allows you to merge a set of arrays into a single array, the dreaded flatmap allows you to convert an array of objects into an array of arrays which then get flattened, and reduceRight allows you to invert the order in which your reducer is applied to your input values.