JavaScript: Why is 'b' undefined in this code? Function Scope - Block Scope

preview_player
Показать описание
JavaScript Shorts · What Do You Mean With Function Scope Variable

What does it mean ❓ A function scoped variable

JavaScript "var" vs "let" function scope vs block scope

JavaScript: Variables declared using "let" keyword have block scope

JavaScript scope, accessibility of variables

JavaScript Shorts:
Рекомендации по теме
Комментарии
Автор

Explanations:

JavaScript "var" vs "let" function scope vs block scope

JavaScript: Variables declared using "let" keyword have block scope

JavaScript scope, accessibility of variables

JavaScript Shorts · What Do You Mean With Function Scope Variable

oneminutecoder
Автор

Var has functional scope, let has block scope, so b variable will not be able to access the value from if loop block

pravinmhalsekar
Автор

Because let is blocked scope and var is universal scope ❤

solankiviral
Автор

let has a limited scope - it reaches only “if block” scope.

MrDoug
Автор

Let has block scope never output outside the if statement Vs Var has global scope it output outside the if statement

abhishektalwar
Автор

Var is Function scope and let is block scope

ramighazzawi
Автор

cuz b is in a block scope and that's the why of meaning among global and local var

davejackson
Автор

b inside block scope, it's not accessible globally

KarthikKarthik-qlkb
Автор

B/c of block scoped 'let' declaration. Duh

TheMisterSpok