1//create an array like so:
2var colors = ["red","blue","green"];
3
4//you can loop through an array like this:
5for (var i = 0; i < colors.length; i++) {
6 console.log(colors[i]);
7}
1//create an array:
2let colors = ["red","blue","green"];
3
4//you can loop through an array like this:
5//For each color of the Array Colors
6for (color of colors){
7 console.log(color);
8}
9
10//or you can loop through an array using the index:
11for (var i = 0; i < colors.length; i++) {
12 console.log(colors[i]);
13}
1//An array is a list of thing, you can add as many things as you want
2
3var food = ["cake", "apple", "Ice-Cream"]
4
5//You can use Math.Random to pick a random number
6//from one to the length of the array
7
8var Number = [Math.floor(Math.random() * food.length)];
9//then we can console.log the random word from the array
10console.log(logammounts[woodloot])
1//array methods
2https://stackoverflow.com/questions/351409/how-to-append-something-to-an-array
1switch(mySwitchExpression)
2case customEpression && mySwitchExpression: StatementList
3.
4.
5.
6default:StatementList
7