Block Scope
noun
say it: “BLOK skohp” /blɒk skoʊp/
The area between a pair of curly braces, such as an if or a loop; a let or const made there can be used only inside those braces.
What is Block Scope in JavaScript?
Block Scope — The region inside braces where let and const declarations are available.
if (orderReady) {
const message = "Ready";
}
In a sentence
- “The message made with let inside the if has block scope, so it's gone after the closing brace.”
Level: Novice · More JavaScript terms at this level
Updated