let coll, sum; coll = [10, 20, 30, 40]; sum = 0; for (let i=0; i<coll.length; i++) { sum += coll[i]; } prn("sum: " + sum);
let coll, sum; coll = [10, 20, 30, 40]; sum = 0; for (let eachElement of coll) { sum += eachElement; } prn("sum: " + sum);
let coll, sum;
coll = [10, 20, 30, 40];
sum = 0;
coll.forEach(eachElement => sum += eachElement);
prn("sum: " + sum);