Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js sum of int in array

const sum = [1, 2, 3].reduce((partialSum, a) => partialSum + a, 0);
console.log(sum); // 6
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #sum #int #array
ADD COMMENT
Topic
Name
2+1 =