Scope, Variable, and Hoisting
3 min readMar 10, 2022
Scope determines the accessibility or visibility of variables.
Traditionally, JavaScript has two types of scope: global and function.
ES6 has introduced a new type of scope: the block scope. Typical examples of the block scope include the IF statement, the FOR statement, and the WHILE statement. An object literal is not a block scope, thought it looks like one.