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 Working with 'for' Loops Create a for Loop

Geoffrey Burkholder
seal-mask
.a{fill-rule:evenodd;}techdegree
Geoffrey Burkholder
Full Stack JavaScript Techdegree Student 1,881 Points

My answer works in the console, but it is still wrong?

I wrote a block of code that answers the question asked when i put it in the console. but it is still wrong?

script.js
for (let j =5; j <= 100; j ++) {
  console.log(`#${j}`);
}

4 Answers

Steven Parker
Steven Parker
231,269 Points

It's important to only do what a challenge asks in order for it to be able to score your result properly.

In this case, they asked that you log just the numbers, so converting them to strings and adding the "#" symbol in front is confusing the checking system. Just log each number itself and you'll pass:

  console.log(j);

Hi Steve! I'm having the same problem with the console command. can you help?

Steven Parker
Steven Parker
231,269 Points

If your issue isn't exactly the same (and resolved by the answer given here), then start a new question, and show your code there.

From the challenge page, use Get Hints :point_right: Ask the Community :point_right: Post a new question.

Thanks Steven! I figured it out.