Hello,
I don’t seem to understand why the below code gives output as total = 0 instead of 20.
var myArr = [ 2, 3, 4, 5, 6];
// Only change code below this line var total = 0;
for (var i = 0; i < myArr.lenght; i++) { total += myArr[i]; }
Try with length instead of your lenght line 16
Thanks, Nabi…