1some_array = ["John", "Sally"];
2some_array.push("Mike");
3
4console.log(some_array); //output will be =>
5["John", "Sally", "Mike"]
1array = ["hello"]
2array.push("world");
3
4console.log(array);
5//output =>
6["hello", "world"]
1let array = ["A", "B"];
2let variable = "what you want to add";
3
4//Add the variable to the end of the array
5array.push(variable);
6
7//===========================
8console.log(array);
9//output =>
10//["A", "B", "what you want to add"]
1var fruits = ["Orange", "Apple", "Mango"];
2var moreFruits = ["Banana", "Lemon", "Kiwi"];
3
4fruits.push(...moreFruits);
5//fruits => ["Orange", "Apple", "Mango", "Banana", "Lemon", "Kiwi"]
6