1some_array = ["John", "Sally"];
2some_array.push("Mike");
3
4console.log(some_array); //output will be =>
5["John", "Sally", "Mike"]
1var vegetables = ['Capsicum',' Carrot','Cucumber','Onion'];
2vegetables.push('Okra');
3//expected output ['Capsicum',' Carrot','Cucumber','Onion','Okra'];
4// .push adds a thing at the last of an array
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"]