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 Create a for Loop

Blake Runyon
seal-mask
.a{fill-rule:evenodd;}techdegree
Blake Runyon
Full Stack JavaScript Techdegree Student 7,525 Points

Loops

This is getting old... I put this in a browser console and it works, yet it's telling me I don't have the right answer.

script.js
for ( let i = 4; i <= 156; i += 1 ) {
  console.log(i);
}

1 Answer

Steven Parker
Steven Parker
217,443 Points

Be careful about testing challenges externally, the code may run fine but not meet the objective.

But in this case, that is a correct solution. Try restarting your browser.

Blake Runyon
seal-mask
.a{fill-rule:evenodd;}techdegree
Blake Runyon
Full Stack JavaScript Techdegree Student 7,525 Points

Hey Steven, thanks for the warning :D

I did try restart many times :( idk why it won't work. 3rd challenge where I think I have it correct but it doesn't seem to work. Bummer.

Steven Parker
Steven Parker
217,443 Points

This is definitely correct. To be certain, I copied and pasted the code above directly into the challenge and it passed.

It might be worth a try to reboot the computer itself.