1. Home
  2. Javascript
  3. Push

Use push method to append a new item to the end of an array.

#javascript#array
var colors = ["red","green","blue"];
colors.push("yellow");
// ["red","green","blue","yellow"]
copy
Full Javascript cheatsheet