JavaScript Tutorial Part 3 - Difference Between var let & const

preview_player
Показать описание

We need to stop saying:
var is hoisted. (it makes people naturally think value 1 in "var a = 1;" is hoisted, but it's actually not.)

Replace that commonplace definition with:
Value of a variable is set to undefined when its name is hoisted.

Explore JavaScript var let and const variable difference. In order to understand them we need to understand a bit of the EcmaScript 5 (ecmascript5, es5) and EcmaScript 6 (ecmascript6, es6) background info.

They are all pretty simple, and basically let and const are constrained for use to the scope in which they were defined. Whereas var -- the older counterpart from EcmaScript 5 (since year 2009) will "hoist" the identifier name (but not the value) up all the way to the global scope.

Self-education + Computer Literacy
For next generation of teachers,
artists, coders, designers, and makers of things:
Рекомендации по теме
Комментарии
Автор

Please continue with the series, you are one amazing person with an in depth knowledge of JavaScript . And honestly, this is how I want to be explained every topic in JavaScript. Please keep this up. You are valuable.

NishantGuleriaiamnishant
Автор

Perfect ! You are really talented IT_man ! So thank you for this so important combinations & dependencies ! Big respect = merci !

justyna
Автор

Thank you for your 3rd tutorial. A great one!
The last part is extremely important though widely unknown between coders

sergiomartin
Автор

Wonderful tutorial, can't wait for the next one.

artie