Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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

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 🙂