JavaScript

Scope

Definition

The region of code where a variable is accessible. JavaScript has global scope, function scope, and block scope. Block scope was introduced with `let` and `const` in ES6.

Code Example

Javascript
Tip: Modify the code above and click “Run” to see the results

Learn More

Related Terms