var let const - Variable Declarations in JavaScript

preview_player
Показать описание
The original variable declaration in JavaScript was "var". This gave us local and global scope.
In ES6, we gained the ability to create block scoped variables as well as constants. "let" gives us a replacement for variable declaration which is block scoped. "const" lets us create constants, which are variables that cannot be reassigned with new values.
Рекомендации по теме
Комментарии
Автор

Thank you very much for these super crystal-clear explanations!

rotrose
Автор

3:43 How is a block-level global variable (let) different from a non-block-level global variable (var)?

johnywhy
Автор

excellent series..going through them one by one..!!
hope u et maore subscribers the numbers aint doing justice to ur knowledge!!

kapkaal
Автор

hey Steve, does let variables are not hoisted.
//
console.log(a);
let a;
Gives a reference error
//
a = 5;
console.log(a);
let a;
This gives a reference error too
//

jasbindarsingh
Автор

Another great video! Unrelated question: How do you get the black box shadow on the ( 55%?) linear gradient for your youtube thumbnail?

jeff.thecoder
Автор

Var values can bleed out from one local scope into the block containing said scope. and jump scopes. So Let and Const are stricter.

EDC.EveryDayCode
Автор

Love your Lord of the Rings references

Rajeshwari