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 trialPhil Smithies
4,179 PointsCreating a for loop counting to 100
I'm slightly confused the code is saying it should count to 100 from 5, it looks like its doing that already.
for ( let counter = 5; counter <= 100; counter++ ) {
console.log(`The number is ${counter}`);
}
4 Answers
Ashish Mehra
2,411 PointsBrian Board
6,328 PointsI did exactly that and I still get this message: "Bummer: The console should display 5
the first time through the loop and 100
the last time."
Phil Smithies
4,179 PointsThankyou!
Karina Rogers
Front End Web Development Techdegree Graduate 15,909 PointsUPDATE: I had to change 'console.log (${i}
);' to 'console.log (i);' and it worked.
I did the same thing and also got "Bummer: The console should display 5
the first time through the loop and 100
the last time." ... I tested it in my console and it seems to run fine? Not sure where to go from here...
for ( let i = 5; i <= 100; i++) {
console.log (`${i}`);
}