Created
October 23, 2020 17:28
-
-
Save walidmahade/85ac36eaca983f81f5fd0bf3587148a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let a = 10; // save 10 inside varialbe 'a' | |
let x = 0; // // save 0 inside varialbe 'x' | |
while(x < a) { // condition is - as long as value of 'x' is less than value of 'a', we will run the following code | |
console.log( x ); // print current value of 'x' to the console | |
x = x + 1 // then, add 1 to current value of 'x' | |
} | |
/* | |
That loop will run 11 times and print - | |
0 | |
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment