Block Scope Explained in JavaScript, What is Block Scope, Codecademy's Learn Programming in JS ES6

preview_player
Показать описание
In this JavaScript lesson we look at Block Scope Explained in JavaScript, What is Block Scope, Codecademy's Learn Programming in JS ES6. This lesson is from the Scope section and in the previous lesson we looked at global scope in JavaScript where we learned that variables declared outside of blocks are accessible everywhere. In this lesson, we looked at block scope variable declarations and learned that a variable that is declared within a block of code, is only accessible within that block of code. When we try to call a variable that we declared within a block, outside of the block, we get a reference error. Understanding global scope and block scope in JavaScript is very important for any developer trying to master this programming language!
Рекомендации по теме