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 array = [];
2var element = "anything you want in the array";
3array.push(element); // array = [ "anything you want in the array" ]