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 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
212,140 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);
Allen Dean
Allen Dean
3,995 Points

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

Steven Parker
Steven Parker
212,140 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.

Allen Dean
Allen Dean
3,995 Points

Thanks Steven! I figured it out.