Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript reduce return array

var store = [0, 1, 2, 3, 4];

var stored = store.reduce(function(pV, cV, cI){
  console.log("pv: ", pV);
  pV.push(cV);
  return pV; // *********  Important ******
}, []);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #reduce #return #array
ADD COMMENT
Topic
Name
9+2 =