A Simple Explanation of Scope in JavaScript| More About Block Scope

A Simple Explanation of Scope in JavaScript| More About Block Scope

In this video I have discussed about block scope in detail. What is Scope? Scope determines the visibility or accessibility of a variable or other resource in the area of your code. Global Scope There's only one Global scope in the JavaScript document. The area outside all the functions is consider the global scope and the variables defined inside the global scope can be accessed and altered in any other scopes. Block Scope A block scope is the area within if, switch conditions or for and while loops. Generally whenever you see {curly brackets}, it is a block. In ECMAScript 2015 onwards, const and let keywords allow developers to declare variables in the block scope, which means those variables exist only within the corresponding block. Previous video:    • A Simple Explanation of Scope in JavaScrip...