Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JavaScript Array reduce()

const numbers = [45, 4, 9, 16, 25];
let sum = numbers.reduce(myFunction);

function myFunction(total, value, index, array) {
  return total + value;
}
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #JavaScript #Array
ADD COMMENT
Topic
Name
8+2 =