1// A javascript array is a list of elements in one variable.
2
3//make an array like this:
4var array = ["Nothing", "Something", 510, "anything"]
5
6//You can log how many elements are in the array:
7console.log(array.length);
8
9// You can log a ["With your text and numbers in here"]:
10console.log(array)
11
12//you can also loop through an array like this:
13for (var i = 0; i < array.length; i++) {
14 console.log(array[i]);
15}
16// "pop" will remove the last element from the array
17var poppedarray = array.pop()
18// Will output: ["Nothing", "Something", 510].
19
20var pushedarray = array.push("anything");
21// Now back to the original!
22
23// now get the position of an element and their name:
24fruits.forEach(function(item, index, array) {
25 console.log(item, index);
26});
27// Nothing 0
28// Something 1
29// 510 2
30// Anything 3
31
32