Please i need help. on this challenge

Tell us what’s happening:
i was having difficulty result get the challenge done, I have done it on multiple tried.

  **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.length; i++) {
total += myArr[i];

  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36

Challenge: Iterate Through an Array with a For Loop

Link to the challenge:

Hello there.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more information you give us, the more likely we are to be able to help.

Hey there… you are logging a STRING to the console.
You want to log the variable total…not the string “total” =)

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