1var colors=["red","white"];
2colors.push("blue");//append 'blue' to colors
1const myArray = ['hello', 'world'];
2
3// add an element to the end of the array
4myArray.push('foo'); // ['hello', 'world', 'foo']
5
6// add an element to the front of the array
7myArray.unshift('bar'); // ['bar', 'hello', 'world', 'foo']
8
9// add an element at an index of your choice
10// the first value is the index you want to add at
11// the second value is how many you want to delete (0 in this case)
12// the third value is the value you want to insert
13myArray.splice(2, 0, 'there'); // ['bar', 'hello', 'there', 'world', 'foo']