# Scope

Where in the code a variable can be used.

## 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;
}
```

Level: Apprentice · [More JavaScript terms at this level](https://www.ask-codey.com/glossary/subjects/javascript/apprentice)

Updated: September 27, 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)

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