block scope vs. function scope vs. global scope #coding #javascript #tutorial #shorts

preview_player
Показать описание
Block scope: Introduced with ES6. A variable declared within a block { } can be only accessed within the block that it was declared

Function scope: A variable declared within a function can only be accessed within the function that it was declared

Global scope: A variable declared outside of a function or a block can be accessed within all scopes.
Рекомендации по теме
Комментарии
Автор

Thanks this would really help for the beginners…!!

satyampc