add items to javascript array code example
Example 1: javscript append item from array
let foo = ['oop','plop','copo'];
foo.push("plop");
Example 2: js push array
var array = [];
var element = "anything you want in the array";
array.push(element); // array = [ "anything you want in the array" ]
Example 3: javascript array push
let animals = ["dog","cat","tiger"];
animals.pop(); // ["dog","cat"]
animals.push("elephant"); // ["dog","cat","elephant"]