shift()

An Array method that removes and returns the first item.

What does shift() do in JavaScript?

shift() — An Array method that removes and returns the first item.

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

Level: Apprentice · More JavaScript terms at this level

Updated