Iterate with a for loop

Tell us what’s happening:
Describe your issue in detail here.

my total isn't equal to 20. I don't get the right solution also reading all your explanations. Can anyone give me a hand? Thanks a lot

  **Your code so far**

// Setup
const 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];
  **Your browser information:**

User Agent is: Mozilla/5.0 (Linux; Android 6.0.1; P01T_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.181 Safari/537.36 (Ecosia android@88.0.4324.181)

Challenge: Iterate Through an Array with a For Loop

Link to the challenge:

All is good.
Look at length. You just misspelled it.

thanks a lot: i was gettin' mad on trying many different ways, and the gth confused me...😁

You really should be using let instead of var.

i've already did it, thanks 😊

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.