push()

noun

say it: “PUSH” /pʊʃ/

The JavaScript array method that adds items to the end.

What does push() do in JavaScript?

push() — An Array method that adds values to the end and returns the new length.

const tasks = ["Test"];
tasks.push("Deploy");

In a sentence

  • “cart.push("Chai") added Chai to the end of the cart.”

Level: Apprentice · More JavaScript terms at this level

Updated