# Rest Parameter

*noun*

say it: **“REST puh-RAM-uh-ter”** **/rɛst pəˈræmɪtər/** or **“DOT DOT DOT”** **/dɒt dɒt dɒt/**

A last function parameter written with three dots, such as ...scores, that gathers all the remaining arguments into one array.

## What is **Rest Parameter** in JavaScript?

**Rest Parameter** — A final function parameter beginning with ... that collects remaining arguments into an array.

```javascript
function total(...prices) {
    return prices.reduce((sum, price) => sum + price, 0);
}
```

## In a sentence

- “Thanks to the **rest parameter**, addToCart('mug', 'beans', 'filter') put all three items in one array.”

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/rest-parameter
