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 Exiting Loops

armand Rodriguez
armand Rodriguez
7,830 Points

Quiz Answer

"Create a for loop that logs the numbers 4 to 156 to the console. To log a value to the console use the console.log( ) method."

I really need help with this and I feel like there's something I'm just not getting. If anyone can lead me in the correct direction that would be amazing!

2 Answers

Steven Parker
Steven Parker
231,248 Points

Starting about 5 minutes into the For Loops video, there's an example of how to construct a loop which is very similar to what is needed for this challenge. Instead of creating html, this time you will use the console.log function to log the loop variable. Another difference will be the specific starting and ending values of the loop, but otherwise it will be very similar.

Take another look at the video and give it a try with these hints in mind.

armand Rodriguez
armand Rodriguez
7,830 Points

Thank you. I figured it out after so much wasted time! Wasn't as hard as I made it out to be for some reason