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 Exit a Loop

Dennis Trinidad
seal-mask
.a{fill-rule:evenodd;}techdegree
Dennis Trinidad
Full Stack JavaScript Techdegree Student 759 Points

I dont understand the third paragraph

it says that variable is no longer valid when its less than 10, but in this example is 0

for ( let i = 0; i <= 100; i++ ) {

1 Answer

Steven Parker
Steven Parker
231,269 Points

I assume you mean the third line of the first paragraph. It isn't talking about that code sample, it is just giving an example of an exit condition you could check for.

The code shows the second example mentioned in that paragraph, which is "less than or equal to 100".