The `shift()` method removes the first element from a JavaScript array.
It changes the original array, returns the element that was removed, and shifts every remaining element one position toward index zero. For example, `["red", "green", "blue"].shift()` returns `"red"`, leaving `["green", "blue"]` behind.
A frequent mix-up is `pop()`, which removes the last element instead. `unshift()` works at the front too, but it adds one or more elements rather than removing them. `splice()` can remove elements from arbitrary positions, including the beginning, but it is a more general operation; for the straightforward first-element operation, `shift()` is the canonical answer.
Calling `shift()` on an empty array returns `undefined`. Because it reindexes the remaining elements, repeatedly shifting a very large array may be less efficient than using a queue structure with a separate index. Still, `shift()` is the standard, readable method for ordinary array-front removal.