1. Home
  2. ›
  3. Javascript
  4. ›
  5. 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