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

Published: 01 January 1970
on channel: Bhanu Prathap
20
2

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 Java...  


Watch video A Simple Explanation of Scope in JavaScript| More About Block Scope online without registration, duration hours minute second in high quality. This video was added by user Bhanu Prathap 01 January 1970, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2 once and liked it people.