Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sum of numbers array using for loop in javascript

let numbers = [10,20,30,40,50];
let     sum = 0;

for(let i =0; i< numbers.length; i++) {
    sum += numbers[i];
}
console.log(sum);

// Output : 150
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sum #numbers #array #loop #javascript
ADD COMMENT
Topic
Name
8+2 =