add elements to list javascript code example
Example 1: javascript append to array
var colors=["red","white"];
colors.push("blue");
Example 2: add item to list javascript
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.push("Kiwi");
Example 3: javscript append item from array
let foo = ['oop','plop','copo'];
foo.push("plop");
Example 4: javascript append element to array
var arr = [
"Hi",
"Hello",
"Bonjour"
];
arr.push("Hola");
console.log(arr);
Example 5: javascript append list
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.push("Kiwi");
Example 6: how to push array
var numbers = [1, 2, 3, 4];
numbers.push(5);
var words = ["one", "two", "three", "four"];
words.push("five")