-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy path1-LA-Practice.js
More file actions
84 lines (25 loc) · 923 Bytes
/
1-LA-Practice.js
File metadata and controls
84 lines (25 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// PROTIP YOU CAN USE CTRL + / TO COMMENT OUT ANY LINE OF CODE, TRY IT OUT!!!
// CTRL + / TO UNCOMMENT AS WELL
// Write a for loop that counts from 0 to 10 and AFTER ten console.logs('DONE!')
// I'll write one that goes from 1 to five then DONE!
for(var i = 1; i <= 6; i++){
if(i <= 5){
console.log(i)
} else {
console.log('DONE!')
}
}
// Write yours here:
// Now write a for loop that counts BACKWARDS from 10 to 1 and AFTER ten console.logs('DONE!')
// hint: use -- instead of ++
// Write yours here:
// Now write a while loop that does the same things as the other two for loops. (one that counts up, and one that counts down)
// I'll write a while loop that starts at 5 and keeps going up to 50 by fives:
// var i = 0
// while(i < 50){
// i+= 5
// console.log(i)
// }
// console.log('WHILE OUT')
// Write yours here:
// Write yours here: