# reduce()

*noun*

say it: **“rih-DOOS”** **/rɪˈduːs/**

The JavaScript array method that combines all items into one value, such as a total.

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

**reduce()** — A stream operation that combines elements into one result.

```javascript
const prices = [2, 3, 4];
const total = prices.reduce((sum, price) => sum + price, 0);
```

## In a sentence

- “cart.**reduce**((sum, item) => sum + item.price, 0) gave the cart's total.”

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

Updated: November 9, 2026

## In other subjects

- [reduce() in Java](https://www.ask-codey.com/glossary/reduce)

Source: https://www.ask-codey.com/glossary/reduce-javascript
