append data array javascript code example
Example 1: append data array javascript
var colors=["red","white"];
colors.push("blue");//append 'blue' to colors
Example 2: prepend to js array
var a = [1, 2, 3, 4];
a.unshift(0);
a; // => [0, 1, 2, 3, 4]