xxxxxxxxxx
let items = [1, 2, 3]
items.push(4); // items = [1, 2, 3, 4]
xxxxxxxxxx
const arr = [1, 2, 3, 4];
arr.push(5);
console.log(arr); // [1, 2, 3, 4, 5]
// another way
let arr = [1, 2, 3, 4];
arr = [arr, 5];
console.log(arr); // [1, 2, 3, 4, 5]
xxxxxxxxxx
//adding items to array
objects = [];
objects.push("you can add a string,number,boolean,etc");
//if you more stuff in a array
//before i made a error doing value = : value
objects.push({variable1 : value, variable2 : value);
//we do the {} so we tell it it will have more stuff and the variable : value
xxxxxxxxxx
var arrayA = [1, 2];
var arrayB = [3, 4];
var newArray = arrayA.concat(arrayB);