Differences Between Var, Let, and Const

preview_player
Показать описание
You have probably watched many different tutorials, and you may have noticed that some tutorials use var to declare variables while others use let or even const. It can get confusing quickly on what the differences are between the keywords, so in this video I am going to be explaining everything you need to know about var, let, and const. I will be going over their differences as well as explaining what situations you should use each keyword.

If you have any suggestions for a JavaScript topic, please let me know in the comments below.

Let vs Const vs Var Article:

Twitter:

GitHub:

CodePen:

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

You have a super rare skill. It's rare to find someone who is both a skilled programmer AND a skilled teacher / communicator. Thank you for your videos

ianoliver
Автор

OMG!! I had seen videos whose explanations were extremely complicated, but you explained it in less than 5 minutes!! Thank you very much

camilafloressanhueza
Автор

Mate, I must say, your hair is on fleek!

Max-nmct
Автор

You forgot to say one more thing: when you declare a variable with var keyowrd, this automatically creates a property inside the Window ojbject.. so, if you say for example: var x = 1; and after that you say: console.log(window)... you will see that in the window object you will find the property X with the value of 1. Instead, if you declare a variable with let or const, this won't ceate a property inside the Window object. I guess this was also very important to mention!

dozadetrezire
Автор

Another super-clear explanation. Love your video style, brevity, and way of explaining everything. Plain and simple!

jthomasaurus
Автор

Thank you for the clear explanation! Currently, I'm learning HTML, CSS & Javascript and if I don't understand something, I'm firstly looking at your channel to find an explanation. If it doesn't exist on your channel, then I'm searching in other sources. You are a very good teacher, your videos are short, consistent and very clear, without any unnecessary content. Thank you very much for sharing your time to make these videos.

TheSlimShdy
Автор

This was great, you speak at just the right speed and your voice is clear. This really helped me and my husband with something in our bootcamp.

dorothyglade
Автор

6:36 I didn't know that. This is why I always watch your videos, even if I think I understand the subject before hand. Great work! 👍

AlexTechie
Автор

Would like to say, well done and thank you for a clear and concise explanation of the similarities, differences and when to use, Var, Const and Let.
Watched other videos and without doubt, you nail it better here with both explanation and example.
Will be watching more of your stuff as this was a great measure stick for the quality of teaching.
Keep up the great work.

AidanJoyce
Автор

This is the best explanation I've ever seen. I do know the differences yet I learnt something new

pratikthorat
Автор

I never knew var worked like this, and I've been using Javascript almost daily for over 2 years. I always assumed it worked like let because I have a background in other programming languages and assumed it's scoping worked the same. So wild! Thanks for the clarification!

tonic.
Автор

This is complete explanation of let vs const vs var I have ever seen. Thanks Kyle 😊

santra
Автор

I am just starting with JS and I was stuck with this like hell. You made it so clear. Thanks a lot!!

raaghavendrahm
Автор

It was very crystal clear explanation thank you.

rohit
Автор

Thank you man, was struggling to understand these basic concepts. You are a lifesaver.

youareuglybuti
Автор

This video came just in time. We are going through Javascript and JQuery right now in my bootcamp!

BASTMDE
Автор

Thank you very much Kyle, This is great. Very explicit. I think I would begin using the 'const' instead of the 'var'
Thanks ✌️

thecoderabbi
Автор

Whenever Kyle comes out with the JavaScript class that he is working on.... I am purchasing it. He is awesome! Thank you Kyle!

dsvhs
Автор

Great great explanation.. you always here that the differences is the 'block scope' and then wonder, well, like within an if or for loop, but nobody else ever says that...

gqntexas
Автор

Thanks a billion, Kyle for explaining the difference among these keywords.

moonlightCR