IT-Lexikon › Programmierung › Scope

Scope

Programmierung Svenska → Aktualisiert: 2026-09-14

Wo im Code eine Variable sichtbar ist — Block-Scope, Funktions-Scope, globaler Scope.

let und const sind in JS block-scoped; das alte var ist funktions-scoped (verwirrend). Lexical Scope = bestimmt durch die Position im Code; Dynamic Scope (Bash) = bestimmt durch den Aufrufer. Closures fangen den Scope für spätere Verwendung ein.

← Zurück zum Lexikon