Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sum of array of number

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