Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js sum

const array = [1, 2, 3];
const result = array.reduce((accumulator, current) => accumulator + current, 0);
// result === 1 + 2 + 3;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #sum
ADD COMMENT
Topic
Name
8+1 =