javascript array push method

JavaScript
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.push("Kiwi"); // Fruits = ["Banana", "Orange", "Apple", "Mango", "Kiwi"];let array = ["A", "B"];
let variable = "what you want to add";

//Add the variable to the end of the array
array.push(variable);

//===========================
console.log(array);
//output =>
//["A", "B", "what you want to add"]array = ["hello"]
array.push("world");

console.log(array);
//output =>
["hello", "world"]const animals = ['pigs', 'goats', 'sheep'];

const count = animals.push('cows');
console.log(count);
// expected output: 4
console.log(animals);
// expected output: Array ["pigs", "goats", "sheep", "cows"]

animals.push('chickens', 'cats', 'dogs');
console.log(animals);
// expected output: Array ["pigs", "goats", "sheep", "cows", "chickens", "cats", "dogs"]
Source

Also in JavaScript: