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 trialTom McVay
Full Stack JavaScript Techdegree Student 12,192 Pointswhy is this not acceptable as a for loop logging numbers 4-156 in the console in JS basics
for (let i = 4; i <= 156; i++) { console.log(i); }
Tom McVay
Full Stack JavaScript Techdegree Student 12,192 PointsIt will not let me proceed. Says there is a parse error.
Tom McVay
Full Stack JavaScript Techdegree Student 12,192 PointsAm not using work spaces. Is just one of those challenge tasks on Javascript loops, arrays etc. Is it possible its a bug in the page? I appreciate your replies, thank you.
Tom McVay
Full Stack JavaScript Techdegree Student 12,192 PointsThanks for the input guys, was the let vs var problem.
2 Answers
KRIS NIKOLAISEN
54,967 PointsSome of the challenges won't accept let. Try var instead.
Carl Evison
2,656 PointsAre you pasting this code directly into the console?
If you are using workspaces run node filename.js
from the console replacing filename.js
with the filename you saved it as.
Carl Evison
2,656 PointsCarl Evison
2,656 PointsWhat do you mean by not acceptable? the code is perfectly valid.