# shift()

*noun*

say it: **“SHIFT”** **/ʃɪft/**

A JavaScript array method that removes the first item from an array, moves everything else up one place, and hands the removed item back.

## What does **shift()** do in JavaScript?

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

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

## In a sentence

- “Each time a song ends, playlist.**shift**() takes the next one off the front and plays it.”

Level: Apprentice · [More JavaScript terms at this level](https://www.ask-codey.com/glossary?category=javascript&level=2)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/shift
