unshift()

An Array method that adds values to the beginning and returns the new length.

What does unshift() do in JavaScript?

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

const line = ["Ada", "Lin"];
const firstGuest = line.shift();

Level: Apprentice · More JavaScript terms at this level

Updated