Hoisting in JavaScript Explained in (About) 5 Minutes

  Рет қаралды 39,913

5-Minute Web Dev

5-Minute Web Dev

Күн бұрын

Пікірлер: 46
@AbsThePunisher
@AbsThePunisher 3 жыл бұрын
BEST DESCRIPTION EVER, i read many articles u made it simple in 5 mins ..perfect man
@abdulbari2569
@abdulbari2569 4 жыл бұрын
Please start again you explain concepts in a great way and you are a great teacher.
@gradar7891
@gradar7891 2 жыл бұрын
Damn I've just asked about this in an interview and sucked! here what they asked: var a = 10; function f(){ if(a){ console.log(a); var a = 5; } } f(); what will that write on console, I said 10. After that fe developer said it is undefined, I was shocked and now I'll learn this, thank you for that video!
@devchannel5232
@devchannel5232 2 жыл бұрын
Mhh, but that is really difficult in my opinion. 'var a = 5' will not be hoisted so normally i would expect as you did that 'if(a)' is 10 and 'console.log(a)' will be 10? But i guess var a = 5 is 'overriding' the global 'var a = 10' but because it is not hoisted it is undefined... Wow very complicated.
@rod8855
@rod8855 3 жыл бұрын
5 min explanation. I had to slow down the video by half. I had to rewatch it. So it took 20mins total lel. But that was awesome!
@devchannel5232
@devchannel5232 2 жыл бұрын
Same. Awesome content in 5mins xD
@prahaladp
@prahaladp 5 жыл бұрын
According to me, you are going very good then why did you stop. Come on and restart with your great videos with great content.
@andrewtcoder
@andrewtcoder 2 жыл бұрын
Thank you for this video! Hope that you will continue to create new videos for this channel soon
@zahidshaikh3122
@zahidshaikh3122 2 жыл бұрын
Now I understood this concept clearly, Thanks Bro!.
@narmadhadevi8167
@narmadhadevi8167 2 жыл бұрын
That was a very clear explanation I got, that too in just 5mins😯🔥.. Please start uploading videos with your awesome way of explaining stuff🙏
@danlevy9478
@danlevy9478 3 жыл бұрын
Best explanation on KZbin, thanks!
@mahmudx
@mahmudx 2 жыл бұрын
I love how you pronounce **Hoisted**.
@terrabyte1154
@terrabyte1154 3 жыл бұрын
Your videos have been super helpful, I hope one day you decide to come back to us! Your videos are hidden gems!!!!
@nehaprakash3073
@nehaprakash3073 3 жыл бұрын
Great Explanation! It would be really helpful if you come up with more such videos as your videos shine among others.. Thanks and Regards!
@westsydezamani
@westsydezamani 2 жыл бұрын
Qsq qqd
@DaveGalligher
@DaveGalligher 2 жыл бұрын
Nice job, thanks.
@fernon
@fernon 3 жыл бұрын
please make more videos! You're rocking it dude! Clear explanations
@EmotionWave_24
@EmotionWave_24 2 жыл бұрын
He is no more
@josephemmanuel4089
@josephemmanuel4089 2 жыл бұрын
Clear and precise. Thanks
@gmontano79
@gmontano79 2 жыл бұрын
Could you make video on layout
@EJ-jh1vf
@EJ-jh1vf 2 жыл бұрын
someone make a compilation of just the breathing sounds
@bhavesh2952
@bhavesh2952 3 жыл бұрын
Short and Useful video :) Please restart with your videos
@jenso413
@jenso413 2 жыл бұрын
great explanation! thanks!
@pixelloopy
@pixelloopy 2 жыл бұрын
Brilliant explanation!
@tuamigoRo
@tuamigoRo 2 жыл бұрын
Excellent, man
@rishavmasih9450
@rishavmasih9450 3 жыл бұрын
You're a legend bro.
@jorgegonzalez4720
@jorgegonzalez4720 2 жыл бұрын
You say there's a compile phase, but I thought JS was an interpreted language, meaning the interpreter looks line-by-line, no?
@5MinuteSmarter
@5MinuteSmarter 3 жыл бұрын
Thank you hope u start making content about web dev again.
@oladapoajala7100
@oladapoajala7100 3 жыл бұрын
At 2:22 your explanation is wrong! The issaVar variable gets hoisted to the scope of the justAfunc() function and assigned 'undefined'. Hence the console.log(issaVar) logs 'undefined'.
@JoeNelo
@JoeNelo 2 жыл бұрын
Isn't JS an interpreted language, and not compiled unless you use a compiler like babel/Jit Compilers? Although we do know with Chrome, the v8 JS VM uses 2 compilers, not all browser engines do this.
@user-wc1sm8cj8s
@user-wc1sm8cj8s 2 жыл бұрын
The first time I encountered this makes me scratch my head. Coming from Python3 background, if you haven't defined something yet, you can't access it. In JS, you can, it's so weird. Thanks for this video, but still, I won't use this feature (just like you said).
@WebbrainAcademy
@WebbrainAcademy 3 жыл бұрын
Awesome!
@MohitGupta-ln2js
@MohitGupta-ln2js 3 жыл бұрын
Great video man
@samuelg.2460
@samuelg.2460 2 жыл бұрын
Dude you need to try cardio. Otherwise love "the 5 min" stuff, short and clear. Thanks!
@pavlins359
@pavlins359 3 жыл бұрын
Very quick talk, hard to understand by non native speakers.
@chilly2171
@chilly2171 3 жыл бұрын
It seems like you don't understand hoisting yourself with the examples. var myvar = "my value"; const myFunction = () =>{ console.log(myvar) var myvar = 'local value' } myFunction() Why does this log undefined when myvar is declared again?
@cheetahcoder5428
@cheetahcoder5428 2 жыл бұрын
This is because console.log has the scope of myFunction and in this function, myvar is initialized after console.
@oussamakhalfi1751
@oussamakhalfi1751 4 жыл бұрын
thank you
@annasaysthings
@annasaysthings 2 жыл бұрын
i wish this guy would contnue :/
@MrMaulikthaker
@MrMaulikthaker 3 жыл бұрын
You are so fast man just calm down while explaining
@HSBTechYT
@HSBTechYT 4 жыл бұрын
Watched in 3 minutes xD
@bob_bobsen
@bob_bobsen 2 жыл бұрын
are you Web Dev Simplified but before the glow up
@gbk_creations
@gbk_creations 2 жыл бұрын
Go slowly it is better
@mintifu1658
@mintifu1658 2 жыл бұрын
sadge, I realized dude stop creating new content 4 years ago
@jackk5746
@jackk5746 3 жыл бұрын
you are screwing up the audience with your fastness hard to understand what you are saying. If you do this again I will not watch any of your videos from your channel.
Code hoisting in javascript
16:49
Hitesh Choudhary
Рет қаралды 74 М.
Let and Const in JavaScript Explained in 5 Minutes
6:25
5-Minute Web Dev
Рет қаралды 1,4 М.
Learn JAVASCRIPT in just 5 MINUTES (2020)
5:15
Aaron Jack
Рет қаралды 1,5 МЛН
Hoisting with var vs let (and const)
9:31
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 14 М.
Learn JavaScript Hoisting In 5 Minutes
5:40
Web Dev Simplified
Рет қаралды 136 М.
5 JavaScript Concepts You HAVE TO KNOW
9:38
James Q Quick
Рет қаралды 1,4 МЛН
Event Delegation in JavaScript Explained in 5 Minutes
5:21
5-Minute Web Dev
Рет қаралды 17 М.
JavaScript Let vs Var vs Constant | Mosh
6:51
Programming with Mosh
Рет қаралды 290 М.
JavaScript FUNCTIONS are easy! 📞
12:14
Bro Code
Рет қаралды 44 М.
WTF Is JavaScript Variable Hoisting
8:50
Colt Steele
Рет қаралды 27 М.
JavaScript Hoisting Explained Simply
6:30
Teddy Smith
Рет қаралды 4,7 М.