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

aarondesigndev
aarondesigndev
2,024 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 28,720 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,024 Points

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

Jeff Muday
Jeff Muday
Treehouse Moderator 28,720 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!