array push method js code example
Example 1: push array javascript
let array = ["A", "B"];
let variable = "what you want to add";
array.push(variable);
console.log(array);
Example 2: how to push array
var numbers = [1, 2, 3, 4];
numbers.push(5);
var words = ["one", "two", "three", "four"];
words.push("five")
Example 3: javascript array push
var fruits = [ "Orange", "Apple", "Mango"];
fruits.push("Banana");
Example 4: push javascript
let twentyThree = 'XXIII';
let romanNumerals = ['XXI', 'XXII'];
romanNumerals.push(twentyThree);
romanNumerals.unshift('XIX', 'XX');
Example 5: push.js
Push.create("Hello world!", {
body: "How's it hangin'?",
icon: '/icon.png',
timeout: 4000,
onClick: function () {
window.focus();
this.close();
}
});