Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JavaScript Array Methods .reduce()

const list = [1, 2, 3, 4, 5];
console.log(list.reduce((number, nextNumber) => number + nextNumber));
// --> 15
Source by github.com #
 
PREVIOUS NEXT
Tagged: #JavaScript #Array #Methods
ADD COMMENT
Topic
Name
2+5 =