-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray.js
More file actions
35 lines (30 loc) · 670 Bytes
/
array.js
File metadata and controls
35 lines (30 loc) · 670 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
//ARRAY
//Array of 10 numbers
array5 = [2,4,6,8,10,12,14,16,18,20]
console.log(array5)
//deleting last two elements from array
array5.pop(9)
console.log(array5)
array5.pop(8)
console.log(array5)
//changing elements to a list of animals
array5[0] = "Elephant"
array5[1] = "Wolf"
array5[2] = "Fox"
array5[3] = "Eagle"
array5[4] = "Parrot"
array5[5] = "Falcon"
array5[6] = "Shark"
array5[7] = "Jaguar"
array5[8] = "Cheetah"
array5[9] = "Cats"
console.log(array5)
//conditions
const modifyArray = 1.1
if (modifyArray > 100){
console.log("yellow Light");
}else if (modifyArray < 100){
console.log("Green Light");
} else {
console.log("number is 0 or less")
}