Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to add numbers in an array in javascript

// how to add numbers in an array in javascript
let number = [10, 20, 40];
let result = number.reduce((a, b) => a + b);
console.log(result); // 70
 
PREVIOUS NEXT
Tagged: #add #numbers #array #javascript
ADD COMMENT
Topic
Name
2+4 =