
UNDERSTANDING SCOPE IN JS L-2 by PRAJJAL DHAR (04)
Types of Scope in JavaScript A. Global Scope Definition: Variables declared outside any function or block have global scope. They can be accessed and modified from anywhere in the code.B. B.Local Scope Definition: Variables declared inside a function are local to that function and cannot be accessed from outside. C.Block Scope Definition: Variables declared with let or const inside a block { } are only accessible within that block. D. Function Scope Definition: Variables declared with var are function-scoped, meaning they are accessible throughout the function but not outside it.