Javascript for statement loop with an array

Description

Javascript for statement loop with an array

let numbers = [3, 7, 12, 22, 100]; 
let sum = 0; /*from   w  w w. j ava2s  .  c om*/
for (let i = 0; i < numbers.length; ++i) { 
   sum += numbers[i]; 
} 
console.log(sum);



PreviousNext

Related