mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-16 21:06:35 +08:00
An important point while using while loop (#25026)
* An important point while using while loop * Grammar fixes
This commit is contained in:
parent
6b9e81cfdf
commit
7886c73726
@ -14,6 +14,7 @@ while(condition) {
|
||||
A key point of the while loop is that the loop might not ever run.
|
||||
When the condition is tested and the result is false, the loop body will be skipped and the first statement after the while loop will be executed.
|
||||
|
||||
Another important point about the while loop is to remember to increment/decrement/modify the variable used for checking the given condition at the beginning of each iteration, at the end of your loop, otherwise the loop will enter into an infinite loop.
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user