8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf0ff44 commit 72e6b39Copy full SHA for 72e6b39
20_for_loop.js
@@ -0,0 +1,28 @@
1
+// for loop
2
+
3
+for (let i = 0; i < 10; i++) {
4
+ console.log(i);
5
+}
6
7
+// Step 0: i = 0;
8
+// Step 1: i < 10 true,
9
+// Step 2:executing the block
10
+// Step 3: i++ = 1
11
+// Step 4: i < 10 true,
12
+// Step 5: executing the block
13
+// ...
14
15
16
17
+// Step X - i++ = 9;
18
+// i < 10 true,
19
+// executing the block
20
+// i++ = 10
21
+// 10 < 10 is false
22
+// get out of the loop
23
24
+console.log('example again');
25
+console.log();
26
+for (let number = 20; number >= 10; number--) {
27
+ console.log('and number is ' + number);
28
+} // 20 ...10
0 commit comments