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

aarondesigndev
aarondesigndev
2,022 Points

For Loop Coding Challenge Issue

Why is this code producing an error? It should be correct. It's correct in the console.

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

2 Answers

Jeff Muday
MOD
Jeff Muday
Treehouse Moderator 27,510 Points

This particular code challenge doesn't support the backtick character. It expects simple logging.

Good luck with JavaScript!

for (let i=5; i <= 100; i++ ){
  console.log(i);
}
aarondesigndev
aarondesigndev
2,022 Points

Thanks Jeff. Although could you please tell me if my answer was technically correct?

Jeff Muday
Jeff Muday
Treehouse Moderator 27,510 Points

You are correct! In the real world of JavaScript, you could do this. Unfortunately, the code challenge was not written this way.

Enjoy JavaScript-- it is arguably the most sought-after skill of web developers!