DC
Why not just use concat instead of push ? make its nice and compact and easy to follow along: const squaresOfNumbers = numArray => numArray.reduce( (acc, item) => acc.concat(item * item), [])
ReplyArticleMar 16, 20171JavaScript Patterns โ Wrangling arrays like a boss, with Array#reduce ๐