# unshift()

*noun*

say it: **“un-SHIFT”** **/ʌnˈʃɪft/**

A JavaScript array method that adds one or more items to the start of an array, moves everything else back one place, 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.

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

## In a sentence

- “I used **unshift**() to put the new song at the top of the playlist instead of the bottom.”

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/unshift
