Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

reduce

const arr = [5, 7, 1, 8, 4];const sum = arr.reduce(function(accumulator, currentValue) {  return accumulator + currentValue;});// prints 25console.log(sum);
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #reduce
ADD COMMENT
Topic
Name
6+1 =