Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

reduce method

const doubledAndSummed = [1, 2, 3].reduce(function(accumulator, element){ return element * 2 + accumulator}, 0)
// => 12
Source by my.learn.co #
 
PREVIOUS NEXT
Tagged: #reduce #method
ADD COMMENT
Topic
Name
5+5 =