# Operator Precedence

*noun*

say it: **“OP-er-ay-ter PRES-ih-dens”** **/ˈɒpəreɪtər ˈprɛsɪdəns/**

The order JavaScript works out a calculation in: parentheses first, then \*\*, then \* / %, then + and -.

## What is **Operator Precedence** in JavaScript?

**Operator Precedence** — The order JavaScript works out an expression in: parentheses first, then `**`, then `*`, `/` and `%`, then `+` and `-`, left to right within each level. Add parentheses when you want a different order, or to make the order clear.

```javascript
console.log(5 + 2 * 4);   // 13: 2 * 4 first, then + 5
console.log((5 + 2) * 4); // 28: the parentheses first
```

## In a sentence

- “Because of **operator precedence**, 2 + 3 \* 4 is 14, not 20.”

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

Updated: November 9, 2026

## In other subjects

- [Operator Precedence in C#](https://www.ask-codey.com/glossary/operator-precedence)

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