JavaScript Let, Const & Var: A Complete Guide

  Рет қаралды 78,100

Colt Steele

Colt Steele

Күн бұрын

Пікірлер: 186
@sarthakgaba1583
@sarthakgaba1583 4 жыл бұрын
Thank you Colt, I just completed your web dev bootcamp on Udemy, that was an amazing course!
@cq7499
@cq7499 4 жыл бұрын
I'm studying now, haha
@prateeksingh4491
@prateeksingh4491 4 жыл бұрын
Yes bro, it's an amazing course!!
@focus-freaks
@focus-freaks 4 жыл бұрын
i just started javascript in the course and upto now it's awesome.
@artemis8342
@artemis8342 4 жыл бұрын
....
@reilly2676
@reilly2676 4 жыл бұрын
Artemis why the ...?
@kirose
@kirose 4 жыл бұрын
Just wanted to say that your course on Udemy is the most helpful learning resource I've found for html, css, and now javascript. Thank you for all the effort you've put into keeping the lessons relevant and up to date.
@melissaginoza2926
@melissaginoza2926 4 жыл бұрын
Thank you for the detailed information. I came from your Bootcamp
@compskilllimited-softwaret5864
@compskilllimited-softwaret5864 3 жыл бұрын
Sounds so simple when you describe things this way. Thank you
@RurouniKenshinShinta
@RurouniKenshinShinta 3 жыл бұрын
Thanks for clarifying in detail the difference between these. Been bouncing around between them for a while never really understanding the difference in any way shape or form. I always just was under the assumption that it was a matter of preference. You clarified this like a BOSS, dude!
@carmelomiuccio1658
@carmelomiuccio1658 4 жыл бұрын
Hi Colt! I'm following The Web Developer Bootcamp , you're the best tutor ever man , thanks for what you're doing!
@dwighthayles1226
@dwighthayles1226 4 жыл бұрын
Hi Colt, Thank you for this! I'm working on your bootcamp for web developers and thanks to this course I'm getting a grasp of basic concepts. Keep up the good work!
@noemonsivais2145
@noemonsivais2145 4 жыл бұрын
I bought this course and didn't understand it much. I took a boot camp course through a university and I am using this as a review. No regrets in buying Colt's course because it is well explained, I just personally wasn't getting it. Now, many things are as clear as day.
@picosofamoso33
@picosofamoso33 Жыл бұрын
Thanks for your videos Mr. Steele on KZbin and Udemy. I've been a student on Udemy for years now and I highly recommend your web developer bootcamp course to any beginner that is looking to learn how to build websites. Not only is it loaded with easy to learn programming but you make it fun, thanks!
@anaavg
@anaavg 4 жыл бұрын
Colt, you are awesome. Thank you for sharing your knowledge with everyone!
@Batsnang
@Batsnang 4 жыл бұрын
Came here from section 10 of the Bootcamp, thanks for keeping it updated and applicable!
@csokan.palandras
@csokan.palandras 4 жыл бұрын
Hi! I'm here from the Udemy course to update the information from "var" to "let" and "const". Great course! Thanks. Cheers.
@aprodan5245
@aprodan5245 6 жыл бұрын
Rusty is back!
@tinypoison2426
@tinypoison2426 4 жыл бұрын
He is dead now 😢
@jasonwarner3490
@jasonwarner3490 4 жыл бұрын
So many nuances, I think I will use var for everything unless I know I need to declare something that will not change (const) or if I only want something declaring inside of it's own block (let)
@DominicNweze
@DominicNweze 2 жыл бұрын
like seriously. I don't even see a point in making other ways of declaring a variable. when other langues ain't doing that .😂
@pranitraj7701
@pranitraj7701 3 жыл бұрын
Now that was a pretty cool introduction to start with. Really liked that beyond convincing style till 0:16
@MM-oq1lb
@MM-oq1lb 3 жыл бұрын
It's the 8th video on YT I'm starting to watch and looking for another one because as usual dudes are talking to other dudes that know already. There are no beginner videos for me. Your glasses are fine.
@rovatk373
@rovatk373 5 жыл бұрын
Didn't know Tom Holland was a programmer
@GALAXYXD
@GALAXYXD 4 жыл бұрын
In fact, he likes to be a WEB developer
@tamcor7576
@tamcor7576 4 жыл бұрын
lol
@MogalMauli
@MogalMauli 4 жыл бұрын
@@GALAXYXD underated comment 😂
@soniauduma1640
@soniauduma1640 4 жыл бұрын
he is a WEB developer
@brainsnackstore
@brainsnackstore 4 жыл бұрын
😂😂
@ebenezerangel6567
@ebenezerangel6567 4 жыл бұрын
Thank you so much.now i'm clear with using var,let,const
@mikeygarcia8597
@mikeygarcia8597 4 жыл бұрын
Let, Const and Var and the quest for the holy script! Great class really digging it.
@sharonng6442
@sharonng6442 3 жыл бұрын
Thank you Colt for the series of JS, HTM: & CSS classes on KZbin! You should go on eDX!
@3y3man
@3y3man 5 жыл бұрын
It's like i just saw 1001 reasons not to use let and const and then you ended it saying "never use var"
@lyingcat9022
@lyingcat9022 5 жыл бұрын
Ayman Bukar NON of those are reasons Not to use let and const. Quite the opposite really.
@truefriend3575
@truefriend3575 4 жыл бұрын
Colt Steele....Thanks so much for your effort....bro i am so happy that i can learn from you...it is so well made.....thanks once again.....
@klementynakwiatkowska986
@klementynakwiatkowska986 4 жыл бұрын
I like your glasses! Just wanted to say I really appreciate the content you make, I have two of your udemy courses which are really valuable. I was actually able to secure a place on a master of data science and artificial intelligence following your courses (and of course hours of individual study), so I just wanted to take a minute to say thank you for creating opportunities to learn and develop new skills.
@kzmOP
@kzmOP 4 жыл бұрын
hey congrats on your achievement! Could you pls share the approach (courses) on AI?
@SergioArroyoSailing
@SergioArroyoSailing 4 жыл бұрын
great video explaining the subtleties! didn't know about the re-declaration ! thanks
@babatundeololade6765
@babatundeololade6765 6 жыл бұрын
It's good to see my instructor here on utube again.
@t.roll21
@t.roll21 2 жыл бұрын
Hey Colt! Gotta say that I absolutely looooove your webdev bootcamp on udemy! You rock man, I'm a huge fan of your teaching style - and, most importantly - your personality :) Your sense of humor is awesome, you have me cracking up every few videos XD Anyways, G-d bless you man! may you prosper in all of your endeavors ;) Keep "doin your thing" bro ;-D ! Much gratitude for all that you do
@GarmrZero13
@GarmrZero13 6 жыл бұрын
Very good presentation! Its good to see you posting videos on your channel again
@n1111shant
@n1111shant 4 жыл бұрын
colt itself is a brand!!!!!!!!!!!
@tenminutetokyo2643
@tenminutetokyo2643 4 жыл бұрын
Awesome, please do a complete course on JS. Just the basics.
@shehreensaifi846
@shehreensaifi846 4 жыл бұрын
thanks colt......i enjoyed your web dev bootcamp on udemy...nice explanation
@urosciric8030
@urosciric8030 4 жыл бұрын
Thank you. I use let and const daily, but need to look at this video before every interview haha
@devbox9922
@devbox9922 3 жыл бұрын
Watched a ton of video about var, but didn't know about window object, that's crazy, Why js, just why!
@jinwookkim8511
@jinwookkim8511 5 жыл бұрын
the Best introductory lesson for let, const & var! 😃
@lubhitmalhotra625
@lubhitmalhotra625 4 жыл бұрын
YOU ARE GREAT SIR. THANK YOU AND I AM YOUR NEW STUDENT.
@leahmattern9465
@leahmattern9465 5 жыл бұрын
Oh my gosh, THANK YOU!! I'm still a bit new to JS, and the different ways to declare variables has been freaking me out! (Also, I dig this glasses!)
@dave_ynh
@dave_ynh 6 жыл бұрын
Thanks! As usual, everything is very clear.
@davinder946
@davinder946 6 жыл бұрын
Hi colt thanks for video. Waiting for your new course. You r one of my best instructor.
@misterfuzzykins
@misterfuzzykins 6 жыл бұрын
Sweet! I've been binging on coding seminar talks, and a lot of them use these. Had a vague idea of what they meant before, but now I'm good to go! Thanks Colt
@IdrisMC
@IdrisMC 6 жыл бұрын
Finally, dont forget to claim your KZbin URL😋 and please answer questions on advanced webdeveloper bootcamp
@ziel_ar
@ziel_ar 6 жыл бұрын
Hi Colt! I would love to see more movies like this one.
@ColtSteeleCode
@ColtSteeleCode 6 жыл бұрын
Let me know if you have any topics you'd like me to cover!
@ziel_ar
@ziel_ar 6 жыл бұрын
How about differences between window, screen, and document in Javascript? I do not catch it fully. If you find this topic interesting enough for the next movie, it would be great, but I will accept any other content equally willingly!
@laszlopaszlavszki3569
@laszlopaszlavszki3569 2 жыл бұрын
Nice and respectful comment
@Rahul-jy9wg
@Rahul-jy9wg 6 жыл бұрын
It's good to see you on KZbin
@urosciric8030
@urosciric8030 4 жыл бұрын
Thanks for the simple explanation
@FiftyKcal
@FiftyKcal 6 жыл бұрын
Great video Colt! Would be great to see more videos of you explaining things like the "this" keyword or .bind, etc.
@stephenpino235
@stephenpino235 4 жыл бұрын
Great focused explanation please keep up the good work
@jessylin7867
@jessylin7867 3 жыл бұрын
pretty clear video!! Thank you!!!
@excessreactant9045
@excessreactant9045 3 жыл бұрын
Thanks colt Well taught
@JatinderSingh-du1ny
@JatinderSingh-du1ny 4 жыл бұрын
Thanks! I've seen your tutorials on udemy also. You're Gifted instructor. Keep it up. It helps many seeker
@srushteesatardey9478
@srushteesatardey9478 5 жыл бұрын
best explanation ever
@katheyjohn93
@katheyjohn93 4 жыл бұрын
Hi....Why do you say at the end of the video that you prefer Const over let and var the least preferred? Thank you:)
@kerryd2060
@kerryd2060 6 жыл бұрын
Great video. I signed up for all your Udemy courses & will start soon. I like that you don't include background music in your courses. I found some of the instructors on Udemy include background music and it is very distracting from the material.
@michaelmedina7889
@michaelmedina7889 6 жыл бұрын
Wow! Now I get it! Thanks Colt you're the best!
@himbary
@himbary 6 жыл бұрын
Wow, yesterday I was searching for a video about them and now this. Thank u
@Ploofles
@Ploofles 4 жыл бұрын
thanks man, really helped out a lot
@agung_laksana
@agung_laksana 6 жыл бұрын
Colt, nodejs course please
@orieiran3487
@orieiran3487 4 жыл бұрын
Thanks Colt. Your awesome!
@areskyberkane9295
@areskyberkane9295 5 жыл бұрын
you are awesome!! From Spain! Thank you so much!!
@Etienne_O
@Etienne_O 6 жыл бұрын
Thanks Colte!! If you could upload your videos in 4k it would be very nice.
@kondasomu
@kondasomu 2 жыл бұрын
Hi sir,I have a doubt when using const keyword value will not change but when I use like this value is changing for 'const' keyword. code is: const x = { name: "scott"}; x.name = "john"; console.log(x); Result:john. Why const is printing john instead of scott. Can you please give me reason.
@SethWilson
@SethWilson 6 жыл бұрын
Thanks for this, was just thinking about this the other day.
@papaOhmTV
@papaOhmTV 6 жыл бұрын
That's deep! Thanks Colt...
@JatinGera
@JatinGera 5 жыл бұрын
Thanks man love your videos
@coolsweatz
@coolsweatz 4 жыл бұрын
Really helpful video 👍🏾
@kondasomu
@kondasomu 2 жыл бұрын
hi sir, I have a doubt while using const keyword const x = {name: "scott"}; x.name = "john"; console.log(x); here 'x' value is john, actually it should be scott. why 'x' value is changing, please clear me
@error53ish
@error53ish 5 жыл бұрын
So if let and const don't get added to the window object... where do they go, if they are globally scoped?
@ar3ol
@ar3ol 4 жыл бұрын
great video, thanks! but i'm still not clear why stay away from var, var seems totally fine to me.
@RmonikMusic
@RmonikMusic 4 жыл бұрын
Basically it's about safety. Using let and const further limits the scope (= in which space the variable exists) so you'll need to declare it in the exact scope you plan to use it in. This will make sure you won't have issues later on because you've forgotten about some variable you or someone else declared in the same scope and try to declare a variable with the same name, etc. In short, it enforces best practices.
@newChiller
@newChiller 4 жыл бұрын
@@RmonikMusic Thanks for the explanation
@Obyvvatel
@Obyvvatel 5 жыл бұрын
And in contrast I only use var, because it's guaranteed to work and I don't mind it being accessible 1 step further when just in if, or for blocks
@JibinPhiliposeDGameR
@JibinPhiliposeDGameR 6 жыл бұрын
Which vscode theme are you using colt?
@ashome7622
@ashome7622 5 жыл бұрын
Hey Colt your glass is a nice one 🤓
@somyasarathisamal
@somyasarathisamal 4 жыл бұрын
As you said var is added to windows, What does it mean??
@kyawn5115
@kyawn5115 4 жыл бұрын
Thank you!
@expansivegymnast1020
@expansivegymnast1020 Жыл бұрын
Noob question what IDE lets you see the console objects like that?
@siddhantjain2402
@siddhantjain2402 6 жыл бұрын
Hi Colt! I took your Udemy course on Full Stack Development and it totally worth it! There is one question I want to ask that I need to choose between Node.js and Django. I am well versed in both Javascript and Python but it is a bit difficult to keep up with both of the frameworks. I want to choose between one and stick with it. Complexity is not an issue, I just want to choose the framework with more power and options. Please let me know what you think about it! :) Thanks!
@siddhantjain2402
@siddhantjain2402 6 жыл бұрын
​@@natnaelabrham200 I am sorry if my question was not clear. I want to focus on one Back-end (server-side) framework rather than two. You can say it is a comparison between Express and Django if you want. And yes, both are written in different languages but they both essentially provides a solution to the same problem. I am a bit lost as to which one is better for server-side scripting. Thanks! :)
@ColtSteeleCode
@ColtSteeleCode 6 жыл бұрын
Hi Siddhant, that's a tough question to answer because it really depends on what you want to build and what your requirements are. I definitely recommend picking one and sticking with it while you are learning, but it doesn't mean you need to stick with that one forever. Most developers learn on a single framework and then branch out later and pick up a couple others. So think of it as picking one framework to start with, rather than picking THE ONE FRAMEWORK TO RULE ALL. Node itself isn't a framework, but there are many Node frameworks you could choose from: Express, Koa, Sails, etc. You really can't go wrong either way, but since you're asking...I would recommend going with python on the backend not because it's any better overall, simply because I think it's a better way of learning. I prefer to teach my in-person students two languages: JS for the frontend and something else on the backend (python usually), I prefer this approach because it really helps make the distinction between frontend and backend clear AND it's always good to know more than one language. I've found that students who learn JS and then go on to also use JS on the backend (node) often don't have a full understanding of how everything works together. In addition, python and django (or flask) have huge communities and lots of resources online. Node frameworks do too, but the community is more fragmented around a larger number of frameworks. This is turning into a really long response, but really...it doesn't matter much. I think it's easy to put too much thought and effort into deciding where to start. I would go with Django or Flask + JS on the frontend. You'll be able to pickup Express or any other node framework extremely quickly afterwards.
@siddhantjain2402
@siddhantjain2402 6 жыл бұрын
@@ColtSteeleCode Thank you so much for the reply! I think I have a clear understanding of what I should do now. Thanks a lot Colt, you are the best! ❤️
@soccer19957
@soccer19957 6 жыл бұрын
Awesome video!!!
@RicardoAlex879
@RicardoAlex879 4 жыл бұрын
Essentially - var - creates/declares new variable. let - allows variables to be reassigned and const - cannot be reassigned
@phuongthuyothi203
@phuongthuyothi203 5 жыл бұрын
Love this video
@logixindie
@logixindie 5 жыл бұрын
Đồng ý!
@brothercaleb
@brothercaleb 5 жыл бұрын
0:12 sooo, those glasses.... wat brand are they? 😜
@ColtSteeleCode
@ColtSteeleCode 5 жыл бұрын
:) They're made by a company called Jins. They were actually really affordable. $60 or $70.
@just-justice-here
@just-justice-here 3 жыл бұрын
Funny how Colt's comment got more likes than the original comment
@ryukai1343
@ryukai1343 4 жыл бұрын
curious why does it matter if its added to the windows object or not?
@independentvariablez7854
@independentvariablez7854 4 жыл бұрын
Steph and Klay? Caught a Golden State fan.
@elatif7214
@elatif7214 3 жыл бұрын
And Kevin lol
@ganeshkumar269
@ganeshkumar269 4 жыл бұрын
var : has an execution context scope, added to window obj. let: block scoped, isn't added to window obj. const : block scoped , isn't added to window obj, reference must not be changed once declared
@green939
@green939 4 жыл бұрын
Thank you so much for such a nice video! I finally got it! :D
@sebastianbasic252
@sebastianbasic252 4 жыл бұрын
So basically, let is behaving like a normal variable in Java or c++?
@DojoDyo
@DojoDyo 5 ай бұрын
Love the glasses, I also have these glasses ! hehe
@ecek123
@ecek123 5 жыл бұрын
var seems more versatile, why shouldn't we use it? and why did they feel the need to create const and let? what is it that var cannot do that created the need for const and let?
@naysolutions4225
@naysolutions4225 4 жыл бұрын
I have found more detail on this topic here #letDeclarations
@theangamba6601
@theangamba6601 6 жыл бұрын
Really helpful
@IdrisMC
@IdrisMC 6 жыл бұрын
What is the window object and the global object, for what is it used?
@erickvalencia7962
@erickvalencia7962 6 жыл бұрын
Window is the global object. So It means that when you run JavaScript code(an script), the global object is automatically created with many things inside. And You can use it for accessing some properties and values and use it in your code.
@lfb640
@lfb640 6 жыл бұрын
Is this the same in Java? I know that are different languajes but ya know my point
@chickenzwings
@chickenzwings 6 жыл бұрын
Nope! Java is called a "statically typed" language. That means when we declare variables in java, we need to be more specific than "let" or "const". ex: int a = 10; Rather than var a = 10;
@jahongirhusanov6878
@jahongirhusanov6878 5 жыл бұрын
@@chickenzwings but it gives the same error when you try to redeclare previously declared and initialized variable.
@divinealien7620
@divinealien7620 5 жыл бұрын
thank you
@TheLittleLadyCook
@TheLittleLadyCook 4 жыл бұрын
Here from the Bootcamp on Udemy ^^
@petrospetrosyan1414
@petrospetrosyan1414 5 жыл бұрын
What's the difference between using “let” and “var”?
@error53ish
@error53ish 5 жыл бұрын
Wait... what are people saying about your glasses? I think they are pretty cool.
@iyleveeranna4134
@iyleveeranna4134 6 жыл бұрын
Thanks Colte 🙂👍
@adrian-4767
@adrian-4767 6 жыл бұрын
Colt I live in a poor country and I prefer you publish a "huge course" on Udemy instead of mini courses is that the first one will always have way more students enrolled in one course than each mini course would have, so even if you Colt can't answer to Q&A then since the "pool of students" is bigger in a huge course we have more chances that another fellow student reply us (which I do if I know something and see another student question unanswered). Lastly, I can afford better buying a huge course than even a cheap a subscription. Please continue publishing your courses on Udemy.
@ColtSteeleCode
@ColtSteeleCode 6 жыл бұрын
Hi Adrian, I understand where you are coming from. I appreciate your input, but you can rest assured, I have no plans to abandon Udemy anytime soon. You don't need to worry! I am exploring some other options in addition to Udemy, but not instead of Udemy. Udemy has been great for me, but it is often extremely unpredictable and volatile. At any moment they can stop promoting my courses (which has happened before). I am at their marketing team's mercy. I am looking into additional, more stable ways of teaching online alongside Udemy. For example, I'm considering doing online tutoring and mentoring for students who want it. In the event that Udemy stops marketing my courses, I would at least have something else going on. If I ever publish courses on my own or not on Udemy, I will always have a way to help my students who cannot afford to pay full price. Students like you are the ones I care the most about teaching.
@lfb640
@lfb640 6 жыл бұрын
Nice vídeo by the way
@icgaming1692
@icgaming1692 4 жыл бұрын
you are a great guy i am learning from your course. can i work with u.
@mohamedaboelfotoh7692
@mohamedaboelfotoh7692 3 жыл бұрын
Wow!
@shirley9049
@shirley9049 4 жыл бұрын
perfect!
@WaldoTheWombat
@WaldoTheWombat 5 жыл бұрын
i don't understand why i shouldn't use var, i understand from your video that it doesn't have any restrictions....?
@Zeeye
@Zeeye 6 жыл бұрын
Hi Colt! :)
JS Arrow Functions: Everything You Need to Know
20:23
Colt Steele
Рет қаралды 31 М.
WTF Is JavaScript Variable Hoisting
8:50
Colt Steele
Рет қаралды 27 М.
風船をキャッチしろ!🎈 Balloon catch Challenges
00:57
はじめしゃちょー(hajime)
Рет қаралды 82 МЛН
JavaScript var, let, and const explained
11:56
Kevin Powell
Рет қаралды 24 М.
Complete Guide to JS Async & Await ES2017/ES8
16:20
Colt Steele
Рет қаралды 18 М.
#38. How to use Var, Let and Const | JavaScript Full Tutorial
8:50
Javascript Window vs. Document vs. Screen WHAT??
9:38
Colt Steele
Рет қаралды 24 М.
JavaScript Let vs Var vs Constant | Mosh
6:51
Programming with Mosh
Рет қаралды 290 М.
The Complete Guide to JS Symbols ES6
12:18
Colt Steele
Рет қаралды 54 М.
5 JavaScript Concepts You HAVE TO KNOW
9:38
James Q Quick
Рет қаралды 1,4 МЛН
JS Spread Operator: How It Works & Why I Love It
16:31
Colt Steele
Рет қаралды 76 М.