js create array add element code example
Example 1: javascript append to array
var colors=["red","white"];
colors.push("blue");
Example 2: js add element to array
var fruits = [ "Orange", "Apple", "Mango"];
fruits.push("Banana");
Example 3: javascript add items to array
objects = [];
objects.push("you can add a string,number,boolean,etc");
objects.push({variable1 : value, variable2 : value);
Example 4: how to append objects to javascript lists ?
var studentList = ['Jason', 'Samantha', 'Alice', 'Joseph'];
studentList.push('Jacob');