I am trying to use shorthand to return an array as follows:
var myArray = [1,2,3]; _.reduce(myArray, function (seed, item) { return seed.push(item);}, []);
I expect it to create an array just like myArray. Instead, for the first element, the seed is an array. Then for the second element, the seed is a number. This causes an error, and the third element is never reached.
What's going on here?
source share