JavaScript ES6 - var, let and const

preview_player
Показать описание
This video we will talk about the three ways you can now declare variables in JavaScript ( var, let and const ). We'll discuss their differences and similarities and show some use cases for each!
Рекомендации по теме
Комментарии
Автор

Beautifully explained, this was the 2nd video I saw on the new feature of es6.. First one did mention about let keyword, but forgot add the simple point of change in scope level. Better than the newboston . Thank you!!

akshaysarkardbit
Автор

Nice run-down here, man. Appreciated!

willsi
Автор

Great explanation, didn't need to re-play.

Hufsa
Автор

const foo IS immutable. 'foo' is a pointer/reference to the object. It doesn't mean the object it points to is immutable, just that the reference is. For that, you would need a library to wrap access or a function/prototype with inner functions controlling access. AKA: Encapsulation . Still, educational.

For java guys:
const foo <==> final Object foo;
let foo <==> (Java's natural scoping)

sideswipe
Автор

Almost everybody misses out to say that "let" and "const" variables are not hoisted but "var" is hoisted .

whoispankaj