File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ // Loops
2+ // repeat run a block of code whilte condition is true
3+ // while loop
4+ // turn on autosave if vcode hangup
5+
6+ // if u declare use const will error cz const can;t change
7+ // const calculate = 10;
8+
9+ // while (calculate == 10) {
10+ // console.log('calculate from : ' + calculate);
11+ // calculate++;
12+ // }
13+
14+ let start = 20 ;
15+
16+ // while (start >= 10) {
17+ // console.log('print start' + start);
18+ // start++; //false and not execute
19+ // }
20+
21+ // while (start >= 10) {
22+ // console.log('print start' + start);
23+ // start++; //will print looping cz always bigger
24+ // }
25+
26+ // while (start >= 10) {
27+ // console.log('print start ' + start);
28+ // start--; //will print 20 ... 10 why 10, cz >=
29+ // }
30+
31+ // while (start > 10) {
32+ // console.log('print start ' + start);
33+ // start--; //will print 20 ... 11 why 10, cz 10 > 10 is false
34+ // }
35+
36+ while ( start < 40 ) {
37+ console . log ( start ) ;
38+ start ++ ; //will print 20 .. 39
39+ }
You can’t perform that action at this time.
0 commit comments