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 trialJose Medina
Front End Web Development Techdegree Graduate 15,656 PointsThe console should write out 4 the first time in the loop and 156 the last time through the loop.
I wrote out the code and tried it in the workspace on a separate window and it works as intended. It DOES write out 4 and 156 in the console.log and everything in between? I'm not sure what I'm missing here.
for ( var i = 4; i <= 156; i += 1 ) {
console.log( i + ' ');
}
2 Answers
Jonathan Grieve
Treehouse Moderator 91,253 PointsHi Jose,
It might just be a simple difference in the string that the code challenge is looking for. I notice you're using the <= operator to make sure all the numbers you need are showing up :)
Try simply removing the string from the console.log method so you're only passing in the reference to the variable! :-)
moses ezekiel
4,554 Pointsfor ( var i = 4; i <= 156; i += 1 )
try i++
Jose Medina
Front End Web Development Techdegree Graduate 15,656 PointsJose Medina
Front End Web Development Techdegree Graduate 15,656 PointsThank you for your reply! That worked out perfectly!