javascript put element in array code example
Example 1: javascript append element to array
var colors= ["red","blue"];
colors.push("yellow");
Example 2: javascript add item to list
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.push("Kiwi");
Example 3: js push array
var array = [];
var element = "anything you want in the array";
array.push(element); // array = [ "anything you want in the array" ]