Tell us what’s happening:
I wrote a code following the instruction. It has not been accepted. I have reviewed others posts, but the only difference I have seen is i instead of total. I understood that I can declare any variable and the same variable I can initialize to run a code.
Your code so far
// Setup
const myArr = [2, 3, 4, 5, 6];
// Only change code below this line
for (let total = 0; total < myArr.length; total++) {
total += myArr.length[total];
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36 Edg/95.0.1020.30
Challenge: Iterate Through an Array with a For Loop
Link to the challenge: