how to push value into array in javascript code example
Example 1: javascript append to array
var colors=["red","white"];
colors.push("blue");//append 'blue' to colors
Example 2: add item to list javascript
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.push("Kiwi"); // Fruits = ["Banana", "Orange", "Apple", "Mango", "Kiwi"];
Example 3: js add element to array
var fruits = [ "Orange", "Apple", "Mango"];
fruits.push("Banana");