1var fruits = ["Banana", "Orange", "Apple", "Mango"];
2fruits.push("Kiwi"); // Fruits = ["Banana", "Orange", "Apple", "Mango", "Kiwi"];
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"]
1const animals = ['pigs', 'goats', 'sheep'];
2
3const count = animals.push('cows');
4console.log(count);
5// expected output: 4
6console.log(animals);
7// expected output: Array ["pigs", "goats", "sheep", "cows"]
8
9animals.push('chickens', 'cats', 'dogs');
10console.log(animals);
11// expected output: Array ["pigs", "goats", "sheep", "cows", "chickens", "cats", "dogs"]