Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Getting One Value from an Array of Items

//Getting One Value from an Array of Items or sum of array
var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
var total = numbers.reduce(function(total, current) {
    return total + current;
}, 0);

console.log(total);
Source by www.kirupa.com #
 
PREVIOUS NEXT
Tagged: #Getting #One #Value #Array #Items
ADD COMMENT
Topic
Name
5+9 =