Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
220,476 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