JavaScript Let vs Var vs Constant | Mosh

preview_player
Показать описание
JavaScript Let vs Var vs Constant -

Subscribe for more videos:

Want to learn more from me? Check out my blog and courses:

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

1) "var" is function-scoped, whereas "let" is block-scoped.
2) Using "var" attaches the variable to the window, whereas "let" prevents it.

sanket_sy
Автор

Mosh is the best teacher, calm and friendly voice, perfect speed and flow of speach. There are only a few software teacher, who increases my mood when following the tutorials and he is one of them!

m.u.
Автор

Finally, I understood the difference between var and let. Great video.

flyingbirds
Автор

I came here to learn about const. I left without that knowledge.

memaimu
Автор

I was searching everywhere to understand the difference and finally found this video. Really helpful! Thanks for making this video. :D

pranjalijambhule
Автор

Short and to the point explanation! Thank you very much! I'm learning JS right now 😁

codinginflow
Автор

The best explanation of let and var keyword so far, Thanks

hardik.motwani
Автор

Thank you so much, that was crystal clear.

ga
Автор

What a wonderful way to explain. loved it.

kicn
Автор

Packed with information, but short and concise. great video

blub
Автор

first time watching your video, great explanation! Thank you for your help!

kevinpatel
Автор

Thanks for this video. Finally understood the difference between var and let

Shiva-zyjq
Автор

CONST is a 'variable' that cannot be changed. It is a CONSTant. This is useful as a control so that you don't inadvertently make a change to a variable. You can define all your variables as CONST and change them as needed if you find you do need to update them.

frankvee
Автор

Great content loko. I subscribed by the 3rd video.

tochachochi
Автор

The best explanation ever! Thank you very much!

evans_
Автор

Finally I understood the differance thanks Mosh !

maulikgevariya
Автор

This video was well done. Mosh, you tha man

jerryrobinson
Автор

Mosh jan, you should add WHY bloating the "window" let say or other objects with variables and functions is bad. watching your video, a novice would think, "well, why would having access to data outside of a scope bad?!", which is a valid and good question. Otherwise, a very nice video, thanks :)

RezaMohseni
Автор

Great video, thank you. So if I declare a variable using let in the global scope, does that have the same scope as the window object?

mikepalazzo
Автор

A great and simple explanation of var vs. let. Thank you Mosh.

samithakulatilaka