Javascript Closure Tutorial | Closures Explained

  Рет қаралды 156,112

Dave Gray

Dave Gray

Күн бұрын

Пікірлер: 405
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Closure is often confused with Lexical Scope. Lexical Scope is an important part of closure, but it is not closure by itself. This tutorial provides several examples that should allow you to distinguish between lexical scope and closure. This tutorial should also allow you to learn how to give examples of closure if you are asked during the interview process. It is important to understand scope when we discuss closure. If you need to learn more about scope, check out my scope tutorial here: kzbin.info/www/bejne/lXacZ4psntt7pMk
@siya.abc123
@siya.abc123 3 жыл бұрын
Thank you Dave ❤️
@renatoscraft
@renatoscraft 3 жыл бұрын
Thank you for another great video Dave!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
@@renatoscraft you're welcome! 🙏
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
@Abhijit Desaithank you! That's a great request 💯 I like that idea.
@Krisler12
@Krisler12 2 жыл бұрын
Hi! Supposing you have some secret JavaScript functions that you don't want anyone to know. Also, that code (functions) are very resource consuming and this is why they need to be client side and not server side so you can't write those functions in python or php. Also, obfuscation of JavaScript is not useful since it can be easily deobfuscated or seen by placing a breakpoint in the debugging tools in the browser. This been said, could you make, please, a tutorial teaching us the best way to protect your secret JavaScript functions without paying for third party services? Thank you so much in advance!
@ukaszpospiech3817
@ukaszpospiech3817 3 жыл бұрын
Out of all the yt tutorials on closures I've watched today, this one's been by far the best. Clearly explained step-by-step with readable code as illustration. Calm voice, proper English pronunciation and slow pace of speaking matter particularly to beginners like me. Unlike most teacher-coders on yt, you're actually capable of teaching. Thank you, good job, I'm going to watch more of your tutorials.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Glad I could help, and thank you! 🙏💯
@binadarabzand2701
@binadarabzand2701 3 жыл бұрын
Thank you, Dave! An extremely complex concept was explained clearly. Finally, I understood what closure is and how to use it in my code. The IIFE was a cherry on top. Thank you again.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Glad to hear it and you're welcome! 💯
@BigSmoke-r9w
@BigSmoke-r9w 10 ай бұрын
Dave grey taught me html and css! Now he's teaching me one of the javascript topics I find hard to understand! I love this guy, he's the best!!
@adventurer2395
@adventurer2395 2 жыл бұрын
You have a laid back, natural, and clear way of explaining things. Much appreciated!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you for the kind words! 🙏🙏
@jim_andrus6466
@jim_andrus6466 2 жыл бұрын
I can't tell you how much I appreciate the pace of your speaking voice when explaining these concepts. So many of these youtube videos, the person is talking insanely fast, and I cannot keep up with all of it.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
I'm glad it helps! 💯 If anyone wants it faster, KZbin lets them speed it up 😀
@nirmalshah9947
@nirmalshah9947 2 жыл бұрын
This is the first video I've come across, so far, that really goes deep into clearly explaining that simply having an inner function and logging its parents' variables isn't a closure but a lexical scope. Brilliant!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it was helpful!
@aya2222
@aya2222 3 жыл бұрын
I spent the whole day looking up videos to understand closure, and finally I could find the best one. Thank you so much.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Thank you so much for the kind words! 🙏💯
@SaketK11
@SaketK11 11 ай бұрын
I has started learning web dev from your html videos ...last april .. thanx for teaching us and making begginer understand the relevant topics....
@captainalpha4853
@captainalpha4853 Жыл бұрын
You explained closures in a way that even a primary school student will understand. You definitely deserve a sub. Thank You so much, Dave!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@jennisonb37
@jennisonb37 Жыл бұрын
I discovered you today, Dave and I am highly impressed with your teaching style. Unlike many other YT videos that teach all this stuff, I can actually understand you. (So many are hard to follow due to the thick accent of the instructor.) I'm looking forward to delving into other videos you have. Thank you!
@DMT9023
@DMT9023 9 күн бұрын
You've earned yourself a subscriber with this video, your examples and they way you explain things clearly has helped me grasp this concept. After watching about 10 videos and reading numerous blog posts, I was really struggling to visualise what was going on. The next time I get stuck I'll be referring to your channel . Thanks Dave.
@m-ok-6379
@m-ok-6379 Жыл бұрын
I was writing closure example after example without really understanding the reason behind it and this video with credit example finally got the closure idea to click. Thank You.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad to hear it helped!
@khaledbenshible2657
@khaledbenshible2657 Жыл бұрын
I spent the whole day looking up videos to understand closure. finally i git it so Thank you so much for clearly and simply explaining
@ichiroutakashima4503
@ichiroutakashima4503 2 жыл бұрын
The majority of videos made by other content educational creators across various websites talk like they're rappers, you sir are different. Things went much clearer after this video and made me realize that the majority of my confusion is because most of my searches were actually lexical scopes and not closures. I really am indebted to you.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome!
@SC-bv6kx
@SC-bv6kx 3 жыл бұрын
Just learned closure several days ago. This video definitely helped me review the concept. It also helped me clear up the confusion about lexical scope. Thanks Dave!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
You're welcome! 💯
@dileepbc5901
@dileepbc5901 Жыл бұрын
this is an underrated tutorial, i had to got to the bottom of the page on the youtube to get this video. these explanations & examples are more than enough to understand what closure is.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad it helped!
@stavroskefaleas6320
@stavroskefaleas6320 6 ай бұрын
Best video tutorial on javascript closures on the whole internet. Period!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 6 ай бұрын
Thank you!
@MasPensador
@MasPensador 10 ай бұрын
Finally I fully understood closure.... thank you and bless you
@hongzhonghu6364
@hongzhonghu6364 2 жыл бұрын
The best and detailed "Closure" explanation on the internet
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! 🙏🚀
@toyosisalami6453
@toyosisalami6453 2 жыл бұрын
Before coming across your video I had already watched three other ones that weren't explanatory enough for me. Thank you so much for this video; I got everything. Thank you.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome! 💯
@joro353
@joro353 2 ай бұрын
This is by far the best tutorial on closures I've watched. Thank you!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 ай бұрын
Glad it was helpful!
@mertasilturk8400
@mertasilturk8400 2 жыл бұрын
i watched too many closure videos but first time i understand clearly . thank you so much
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it helped! 💯
@TusharBorawake
@TusharBorawake 2 жыл бұрын
This is what closure is...I was just thinking lexical scope is closure. Superbly explained. Thanks alot.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You are welcome, Tushar! 🙏
@proactivex
@proactivex 3 жыл бұрын
I watched maybe 10 videos on closure. Finally one person can explain it well, Dave Gray! You also crushed on that song white ladder.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Ha! I do share my name with a few others, but I'm glad I could help with closures! 💯🚀
@connectyonas2149
@connectyonas2149 2 жыл бұрын
I really found this explanation about lexical scope and closure the best one from KZbin. Thank you.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it was helpful! 💯
@slowcoding
@slowcoding Жыл бұрын
감사합니다.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you for the support! 🙏
@dopetag
@dopetag Жыл бұрын
The best teacher to explain advanced concepts of Javascript. Instant subscription!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Welcome aboard! 💯🚀
@MB-hn5qk
@MB-hn5qk 8 ай бұрын
Probably the best Closures video I have ever watched. Thanks!!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 8 ай бұрын
Glad you liked it!
@arescatalin1407
@arescatalin1407 3 жыл бұрын
I have smashed that like button and I hope that this playlist keeps growing as these concepts really make a difference. Thank you for sharing your knowledge with us
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
You're welcome! Glad I could help 💯
@szangyi24
@szangyi24 Жыл бұрын
Dave, thank you so much for this tutorial. I finally got my "Gotchaa!" moment about closures. I watched several explanations before but this really helped me to understand. Lifesaver :)
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad it helped!
@harvard004
@harvard004 2 жыл бұрын
12:45 The important highlight he mentions. IIFE code happens once. The anonymous function inside it only get's returned ONE time (to privateCounter). After that, you can look at privateCounter as: privateCounter = () => { count +=1; console.log(count) } //but with it's own access to private variable "count". -I'm guessing you can say it has enClosed it's scope over the function and it's declared variables. 5:45
@wzup23
@wzup23 7 ай бұрын
Thanks dude, it's so clear. I will definitely rewatch this over and over again until I am very familiar with the concept.
@yogeshkhatri4555
@yogeshkhatri4555 Жыл бұрын
People misunderstand js a lot. People like u make it relevant for us js peeps. Keep going!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@johnmcaulay4348
@johnmcaulay4348 3 жыл бұрын
Thanks man, I've been struggling with this for days! This video finally made me understand closures (it gave me the aha! moment). I liked the way your video went beyond the cliche closure examples which weren't allowing me to actually understand practical uses for closures. Subscribed!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Thanks again, John - check out my tutorials on debounce, throttle, and memoize to see closures put to good use, too. 🚀
@estherokiki5894
@estherokiki5894 9 ай бұрын
Thanks for all you do, Dave. Your videos are the best. I've watched several videos on closures, but none of them explained it better than you did. I finally understand closures!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 9 ай бұрын
Awesome, thank you!
@abdelbasset8280
@abdelbasset8280 3 жыл бұрын
Thanks Dave you could help me to understand the most confusing concept in js, after I read a lot of articles and watched a ton of tutorials.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
You're welcome! Glad I could help. 💯
@DLeRoux
@DLeRoux 2 жыл бұрын
Dave, you need to seriously consider putting together a Javascript course with projects for Udemy. Your explanations are crystal clear. I have found myself doing course after course, stopping, and then trying to find someone else who would be able to explain the concept a bit clearer than the instructor. It wastes a lot of time. I have found myself coming here for the past three or so concepts, and they click straight away. So thank you.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you, Darryl! I do hope to put a premium course together sometime later this year. I am not sure if Udemy is where I will launch it though.
@umairyatoo8490
@umairyatoo8490 3 жыл бұрын
Thank you very much, Dave. You explained it in a very beautiful way possible. You know I had been struggling from this since long. There wasn't any such explanation on the internet! Thanks a lot.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
You're welcome, Umair 🙏
@je3043
@je3043 Жыл бұрын
Just a quick thought. I think the "credits =- 1" line should be at the end of the function since we need to check credits' amount first to evaluate the possibility of playing. In the example we should be able to play 3 times and it only allows two plays. Everything aside, great video and I always find your explanations very helpful!
@imperativeemarketing5546
@imperativeemarketing5546 2 жыл бұрын
I "Thumbs Upped" your video. I've been studying JS recently for a few months, and to my surprise everything is getting easier to understand, like I'm on the steeper part of the learning curve. I've been getting a clearer picture of what closures are, but your explanation helped even more to demystify closures to me. You have a very sensible, logically explanatory and intelligent way of explaining closures. I'll be checking out your other videos because I like your teaching style. Who knows, maybe I'll buy you a cup of coffee :).
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you for the kind words 🙏💯
@youmnaification
@youmnaification 2 жыл бұрын
This is by far the best explanation of JS closure. Thank you Dave. I'm glad I came across your channel.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it was helpful!
@wallacepei4529
@wallacepei4529 3 жыл бұрын
Thank you for clarifying IIFE, it's syntax that has been tripping me up and now I understand what it's doing. Excellent demonstrations for closures.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Thank you, Wallace. 🙏
@RandyHawkinsMD
@RandyHawkinsMD Жыл бұрын
Clear, simple, concise, well spoken and very useful. I followed along with your code in my IDE (Velo) with no difficulty. Thank you.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Great to hear!
@oscargm1979
@oscargm1979 4 ай бұрын
Perfectly perfectly and perfectly explained. Congrats
@shadabs000
@shadabs000 3 жыл бұрын
Finally , finally I could wrap my head around this concept. It's so basic and easy.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Glad I could help! 💯
@georgesword2012
@georgesword2012 Жыл бұрын
Your tutorials are simply the best on KZbin, thanks for your effort you put for creation high quality content for free ! ❤
@stephaniezun
@stephaniezun 3 жыл бұрын
Thank you so much for clearly and simply explaining this concept!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
You're welcome, Stephanie!
@kumarisuman4565
@kumarisuman4565 3 жыл бұрын
This was a great video. I was struggling with closures for some days but now I feel like i understand it now. THANKS Again it was a great video.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Thank you, Kumari. Glad I could help!
@bethcarretta5715
@bethcarretta5715 2 жыл бұрын
I wish I had stumbled across your video sooner! I've been trying to wrap my brain around closures for so long. Super helpful! You got a new subscriber!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you, Beth!
@renras1057
@renras1057 2 жыл бұрын
Best video about closure so far. You are a very good teacher.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you, Ren! 🙏
@mno7x
@mno7x Жыл бұрын
Thank you for your video! This is the most understandable explanation of closures I've seen and has solidified my understanding of the concept. Really appreciate the emphasis on what "lexical scope" is and how it's an integral part of -- but not the whole story with -- closures. Truly awesome! Thank you, good sir!
@mi5956
@mi5956 2 жыл бұрын
Thank you for clear examples, I finally understood. I looked at other youtubers and it was confusing.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it was helpful! 💯
@zm690
@zm690 2 жыл бұрын
This is the best closure explanation for me... Great work.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it was helpful! 💯🚀
@Albert_Hall
@Albert_Hall 2 жыл бұрын
Great! Great! Great! Thank you very much! Very good explanation! Very good examples!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You are welcome!
@pharmakidsarl8449
@pharmakidsarl8449 6 ай бұрын
One of the best video on closure
@kalyann3426
@kalyann3426 Жыл бұрын
It’s so refreshing to listen,well explained.Thank you Dave
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You are very welcome
@tanzimchowdhury320
@tanzimchowdhury320 Жыл бұрын
Thank you Dave, you just got a new subscriber
@abhinavtiwari89
@abhinavtiwari89 8 ай бұрын
This is the best tutorial on Closures. Thank You!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 8 ай бұрын
Glad it was helpful!
@a5tr00
@a5tr00 Жыл бұрын
Finally I understood JS closures! Subscribed!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad to hear that!
@sugarfairy1248
@sugarfairy1248 9 ай бұрын
well chosen examples demonstring the unique characteristics of closure. Finally undertand it now!
@bluevojka
@bluevojka 9 ай бұрын
This was Amazing Dave!!
@leoMC4384
@leoMC4384 2 жыл бұрын
I've been programming on JavaScript for over 2 years, I hope I'll feel ready to apply for a job soon, even being old to start, I'm 36. Until now, if I was asked about Closure I replied about lexical scope. The IIFE explanation was interesting although I knew it already, because I used them on my API. I do full stack with MERN. Anyway, great video, very clear explanation. 👏👏👏
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you, Leonardo 🙏 You're never too old to do what you love - keep making progress! 💯
@erfanfarhadi
@erfanfarhadi Жыл бұрын
your last example was lovely , thank you
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad you liked it!
@shivashankar6043
@shivashankar6043 2 жыл бұрын
Thanks Dave for this video, please continue the advanced js playlist. You explaining hard concepts easy to understand.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome, Shiva! I do plan to do more 🚀🙏
@NadaAlSharqawy
@NadaAlSharqawy 5 ай бұрын
This is the only explanation that made me understand it, thank you
@kostiantynkarzhanov9216
@kostiantynkarzhanov9216 Жыл бұрын
Dave, thank you so much for your tutorials! All of them are very well structured and easy to understand. I really appreciate all the work you do. Thanks again. Awesome channel! 💛
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@hackmeornot2196
@hackmeornot2196 2 жыл бұрын
this man, helps me to understand closure quickly and easily!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad to hear it! 🚀
@alimohammad-lg8sw
@alimohammad-lg8sw Жыл бұрын
Thank you so muchhhh The best closure explanation ever
@gopishivakrishna9707
@gopishivakrishna9707 2 жыл бұрын
Not bored at all. Nicely presented. :)
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! 🙏
@gerar10s
@gerar10s 3 жыл бұрын
Great video! This explains a lot and you've got a new subscriber. It might be my lack of Javascript knowledge but I still don't quite understand why after the first time, every time the parent function is called, only the child function executes and not the WHOLE parent function. I'm going to watch it a few more times and see if it sinks in. Thanks for the video!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Glad it was helpful! This explanation may help... The parent function is only called once. It returns the "child" function. The variable is therefore set to the child function that is returned. Afterwards, using the variable, only the child function is called. The closure allows the child function to still access the variable that was created within the parent. What we're really referring to here is the lexical scope of the function that is returned, but using the parent and child terminology could help! 😀🚀
@ARandomPerson--
@ARandomPerson-- 2 жыл бұрын
Wow that quick explanation really helped. Thx
@GrahamO-g5g
@GrahamO-g5g 9 ай бұрын
Best explaination on the web. Great job sir! Thank you!
@GeorgiosAmsterdam
@GeorgiosAmsterdam 2 жыл бұрын
finally found a video about closures that makes sense. Thanks
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it helped!
@alexandra.thegreat
@alexandra.thegreat Жыл бұрын
Excellent explanation, thank very much for this video!
@chetanjain4616
@chetanjain4616 2 жыл бұрын
just found out about this series! Loving them
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you, Chetan! Glad you like it! 💯
@antonchigurh4125
@antonchigurh4125 2 жыл бұрын
This was a masterclass on how to explain abstract concepts with easy-to-follow, real-world examples. Thank you. Subbed!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Awesome, thank you!
@mohamadybr
@mohamadybr 3 жыл бұрын
This tutorial is so well structured it simplified the closure concept in a brilliant way!! Thanks a lot
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
You're welcome! 💯
@InnaKasyan-f8h
@InnaKasyan-f8h 2 жыл бұрын
Thank you ! The explanation is extremely clear for beginners.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it was helpful! And you're welcome! 💯
@practicalandplannedhomeschool
@practicalandplannedhomeschool 2 жыл бұрын
This video was an instant subscribe. It was well thought out and clear, and I now understand two concepts much better than ever before. Closure kind of blew my mind. Thank you so much for sharing your knowledge!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Welcome aboard! And glad it was helpful!
@josephochoa1269
@josephochoa1269 3 жыл бұрын
Hey Dave! is it possible to say that the example at 3:40 IS an example of a closure, but perhaps an example of a POINTLESS closure. And then the continuing examples are simply showing the benefits of a closure?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
All of the examples in this tutorial exist to give simple examples and understanding of closure. I do have some more advanced JS tutorials showing practical applications of closures. Look at the videos I have for memoization, debounce, and throttle as a few examples of closures practically applied.
@maxralph01
@maxralph01 Жыл бұрын
Awesome. Pretty common concept coming from Laravel, PHP (we call it "a function called from another function"). That made me familiar to the concept beforehand. But I was lost on the application in JavaScript. Amazing, top-notch explanation, Dave! Now, I can use it in JS.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad you liked it!
@srinivasaraoyp3640
@srinivasaraoyp3640 2 жыл бұрын
In the beginning, I found it difficult to understand the topic "closures" it is so confusing. After watching your video demo, I understood it. Thank you very much Dave.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it was helpful! 💯
@joynal_dev
@joynal_dev 3 жыл бұрын
Your videos are absolute gems 💎. Keep up the good work.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Thank you! 🙏
@manochpriyankara6379
@manochpriyankara6379 Жыл бұрын
wow...Great explanation...Thank you, Dave...
@gamewidge
@gamewidge 3 ай бұрын
Hi DaveGray, I’m a student and have completed learning the MERN stack from your channel. I would love to see a course focused on building microservices with serverless architecture. It would be great if you could cover topics like designing, deploying, and scaling microservices using platforms such as AWS Lambda please.
@romanr5962
@romanr5962 2 жыл бұрын
Brilliant explanation IIFE , my friend.Thanks
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it was helpful! 💯
@SuperDarmino
@SuperDarmino Жыл бұрын
Replayed this video several times. I think i now get it finally 😂. W3 definition makes alot of sense now.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Right on! 🚀
@AR7editing
@AR7editing Жыл бұрын
Thank you, I really thought that I know closures, but I was completely wrong, nice video
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Happy to help!
@ikurbano
@ikurbano 2 жыл бұрын
thank you, Dave! as always, easy to understand, yet consise and to the point.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it was helpful! 🚀
@ToddPressleyy
@ToddPressleyy 2 жыл бұрын
Really loved the ball field analogy! At times I’ve struggled to explain the concept of closures to teammates. this will help greatly… thanks for the great content!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it was helpful!
@jiweihe3413
@jiweihe3413 2 жыл бұрын
Thank you! Finally understood this important concept.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad I could help!
@ibnulferdous
@ibnulferdous Жыл бұрын
You made closure clear to me! Thank you so much!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad it helped!
@mikegogl
@mikegogl 2 жыл бұрын
How did I now know about this channel before. Thank you.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome!
@lttaylor2892
@lttaylor2892 2 жыл бұрын
Hello Dave. In your explanation of IIFE, At approximately 3:59, when you are explaining that the console.log returns only once, you stated that the console.log only returns once. Could you explain why (when you call this function for the second and third times) doesn't the console.log occur for the second and third time?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
This is a video about closure. I do not see what you are referring to at 3:59. Are you asking about the IIFE video here instead of the comments of the IIFE video?
@kenluong1838
@kenluong1838 3 жыл бұрын
Hello Dave. Your contents are tremendously helpful to me as a self-directed learner of frontend dev. You've got yourself a new subscriber :). Your explanation of JS closure is crystal clear but I still have a burning question which I hope your could provide clarification. I am tempted to say the reason that nested function still have access to outer function's variable, even after outer function has returned, is that garbage collection can't destroy these variable. They are still referenced by a nested function. In other words, these variables are still present even though the scope in which they were created is not. Thanks again for your time and efforts!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
You're welcome! Good comment, too. I believe you can say the lexical scope of the function still exists because the function exists. 🚀💯
@kenluong5081
@kenluong5081 3 жыл бұрын
Concisely put!
@siya.abc123
@siya.abc123 3 жыл бұрын
This is it, this is the video of you want to understand js closures! Thanks man
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
You're welcome!
@soumadip_banerjee
@soumadip_banerjee 2 жыл бұрын
Thank you Mr.Gray 🤍
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're very welcome! 💯
@joannbarney7210
@joannbarney7210 2 жыл бұрын
Excellent explanation of closure. Thank you!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're very welcome! 💯
@aikmo
@aikmo 2 жыл бұрын
You are the best one that explained it. Thank you a lot.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You are welcome!
@DheerajKumar-di1cv
@DheerajKumar-di1cv 2 жыл бұрын
Thank you, Dave! It's really a complex thing to understand, till date I was confused between lexical scope and Closures. But It's all cleared now :) God bless you
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're very welcome, Dheeraj! 🙏🙏
JavaScript Closures Tutorial (Explained in depth)
19:03
ColorCode
Рет қаралды 77 М.
What is __proto__ ? | Javascript Prototypes Tutorial
23:11
Dave Gray
Рет қаралды 46 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
JavaScript Visualized - Closures
11:34
Lydia Hallie
Рет қаралды 58 М.
Shallow Copy and Deep Copy | Advanced Javascript Tutorial
26:36
5 Must Know JavaScript Features That Almost Nobody Knows
18:06
Web Dev Simplified
Рет қаралды 478 М.
Closures in JS 🔥 | Namaste JavaScript Episode 10
22:44
Akshay Saini
Рет қаралды 887 М.
Learn JavaScript CLOSURES in 10 minutes! 🔒
10:58
Bro Code
Рет қаралды 25 М.
Async JavaScript & Callback Functions -- Tutorial for Beginners
24:21
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН