Concepts

Identifier resolution

Try the free JavaScript compiler

An identifier is resolved through the current lexical environment and outer environment records until a binding is found. Unresolvable ordinary reads throw ReferenceError.

Formal Syntax & Structure

javascript syntaxjavascript
identifier

Working Example

Example Snippetjavascript
const x=3; function f(){return x;} console.log(f());
JavaScript Reference