const num = [13,6,2,11,23,33];
let c = 0;
for (let i = 0; i <= num.length; i++) {
c += num[i];
}
console.log(c);
//NaN
I can’t sum the array with loop. I want to calculate average of the numbers…
is it possibel to sum arrat with loop and without reduce()??
New contributor
Mahdi.Noorallahpour is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.