+ 1

"Once it evaluates to False, the next section of code is executed".What does that mean?

while Loops A while statement is similar, except that it can be run more than once. The statements inside it are repeatedly executed, as long as the condition hold's. Once it evaluates to False, the next section of code is executed???? ▶ Help?◀

1st Nov 2019, 5:17 PM
Elen V
Elen V - avatar
5 Answers
+ 4
That means when once the condition of the loop becomes False, the while loop immediatly stops, and is never run again. The interpreter moves to the next line.
1st Nov 2019, 5:22 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 3
var i = 1; while(i < 10) { i++; // statement in loop body } // This is what they meant by // next section of the code console.log(i)
1st Nov 2019, 5:26 PM
Ipang
+ 2
Ok thank you very much.👍
1st Nov 2019, 5:26 PM
Elen V
Elen V - avatar
+ 1
Thanks. This example really helped me.
1st Nov 2019, 5:32 PM
Elen V
Elen V - avatar