# ReferenceError

*noun*

say it: **“REF-er-ens AIR-er”** **/ˈrɛfərəns ˈɛrər/**

The error JavaScript stops with when code uses a name it can't find, often a typo or a variable that was never created.

## What is **ReferenceError** in JavaScript?

**ReferenceError** — The error JavaScript stops with when your code uses a name it doesn't know: a typo such as `consol`, or a variable that was never declared. The message names the missing word, so check its spelling first.

```javascript
const lattePrice = 4.75;
console.log(latePrice); // ReferenceError: latePrice is not defined
```

## In a sentence

- “I typed totl instead of total and got a **ReferenceError**: totl is not defined.”

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

Updated: November 9, 2026

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