JavaScript JavaScript Loops, Arrays and Objects Simplify Repetitive Tasks with Loops Create a for Loop

Shanice Gipson
Shanice Gipson
1,488 Points

Where is the Error? I keeping getting a parse error where am I going wrong

see code for reference I am not sure where my syntax is off.

script.js
for (let i = 3; i < 157; i++){
  console.log(i);
}

1 Answer

Justin Horner
STAFF
Justin Horner
Treehouse Guest Teacher

Hello, Shanice

Unfortunately, I believe the first part of the issue is with the challenge itself. I was able to get past the parse error by changing let i = 3 to var i = 3.

The second issue is the numbers that are output. The challenge wants the output to be from 4 to 156, so try changing your assignment in the for loop to 4 instead of 3 and you should be good to go!

I hope this helps. Happy coding 🙂