-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathArrays.js
More file actions
41 lines (21 loc) · 745 Bytes
/
Copy pathArrays.js
File metadata and controls
41 lines (21 loc) · 745 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
//What is an array?
const arrayWithNoItems = []
const fullArray = ['a', 'b', 'c', 'd']
//index //0 //1 //2 //3
//Calling an item an array
// fullArray[ index ]
// console.log(fullArray[0])
// console.log(fullArray[1])
// console.log(fullArray[2])
// console.log(fullArray[3])
//Is there a better way to call all items in an array?
//The For Loop.
// for (starting point; ending point; rate through loop) {
// }
// for (index = 0; index < fullArray.length; index = index + 1) {
// console.log(fullArray[index])
// }
//array methods
//.push() = adds an item to the end of an array
//.pop() = deletes the last item of an array
//.splice = can add or delete, one or more items at a spesific part of an array