Glossary term
What is block scope? Meaning for developers
Anything inside a pair of curly braces { }. let and const belong to the block they are declared in; var ignores blocks and belongs to the function.
Learn it properly · JavaScript CoreLesson 9: Block Scope and ShadowingA block is anything inside { }. Simple idea — but var and let react to that boundary in completely different, and sometimes dangerous, ways. What a block creates in memory, how nested blocks chain, and every shadowing rule — legal, illegal, and the function-boundary exception.