# Scope

*noun*

say it: **“SKOHP”** **/skoʊp/**

The part of a program where a variable can be seen and used; outside that part, JavaScript says the name is not defined.

## What is **Scope** in JavaScript?

**Scope** — Where in the code a variable can be used.

```javascript
const taxRate = 0.08;

function addTax(price) {
    const tax = price * taxRate;
    return price + tax;
}
```

## In a sentence

- “The tip variable was made inside the function, so its **scope** ends at the function's closing brace.”

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

Updated: November 9, 2026

## In other subjects

- [Scope in C#](https://www.ask-codey.com/glossary/scope-c-sharp)
- [Scope in Java](https://www.ask-codey.com/glossary/scope-java)
- [Scope in PowerShell](https://www.ask-codey.com/glossary/scope-powershell)
- [Scope in Python](https://www.ask-codey.com/glossary/scope)

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