add item to array in function javascript code example
Example 1: js array add element
array.push(element)
Example 2: javascript append element to array
var colors= ["red","blue"];
colors.push("yellow");
array.push(element)
var colors= ["red","blue"];
colors.push("yellow");