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 trialPrescott Lawani
2,634 Points[Solved] For loop 4 to 156 not being accepted
I don't see what I'm doing wrong here, but it is giving me an error of unexpected token (i)
for ( int i = 4; i <= 156; i++){
console.log(i);
}
3 Answers
Steven Parker
231,268 PointsIn JavaScript, "int" is not a keyword used to define a variable. Try "var" instead.
Mark Casavantes
10,619 PointsI would eliminate the int on your first line and add + " " to space your answers on your console.log line. I hope this is helpful.
Prescott Lawani
2,634 PointsOh duh...thanks Steven. I was thinking C#. I can't believe I let that slip my mind.