js array add element code example
Example 1: javascript append to array
var colors=["red","white"];
colors.push("blue");
Example 2: js array add element
array.push(element)
Example 3: js add item to array
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.push("Kiwi");
Example 4: javascript array add
let yourArray = [1, 2, 3];
yourArray.push(4);
Example 5: javascript append element to array
var arr = [
"Hi",
"Hello",
"Bonjour"
];
arr.push("Hola");
console.log(arr);
Example 6: push javascript
let fruit = ['apple', 'banana']
fruit.push('cherry')
console.log(fruit)