Iterate Through an Array with a For Loop - Output total = 0 even though the code is correct

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 :wink:

Thanks, Nabi… :face_with_hand_over_mouth::rofl::rofl: