JavaScript the Hard Parts: Closure, Scope & Execution Context

Поделиться
HTML-код
  • Опубликовано: 20 окт 2024
  • Watch Will, Codesmith's CEO, delve into one of the most powerful concepts in programming: Closures. Here's what you'll learn:
    How closure works under the hood
    Core JS runtime features - execution context, JavaScript execution model and the variable environment
    How to able to wield, optimize and debug popular pro utility functions like once and memoize
    How to be able to implement the module pattern - one of the cleanest and most resilient design patterns in JavaScript
    To test your understanding of these concepts and find more videos, challenges, and solutions you can make a free account on CSX - csx.codesmith.io/
    SUBSCRIBE for more! 👉tinyurl.com/co... 👈
    Stay connected to our community!
    Codesmith: www.codesmith.io/
    Learn JavaScript for Free: csx.codesmith.io/
    Free Events & Workshops: www.codesmith....
    Follow us to stay updated!
    Facebook: / codesmithhq
    Instagram: / codesmithio
    Twitter: / codesmith_
    LinkedIn: / codesmith-llc
    #codesmith #javascript #learntocode

Комментарии • 70

  • @selinov
    @selinov 4 года назад +37

    The best explanation of Closures I have ever heard… hands down. Sure, a 10 second definition would be faster but Will has learned how to make it stick in a student's head by making us do the work. 👏

  • @SwimInAPondInTheRain
    @SwimInAPondInTheRain 3 года назад +21

    I admire how much care he puts into stepping through each function, line by line, and by hand. It didn't occur to me how many coding lectures/tutorials did not do this

    • @neilzedd8777
      @neilzedd8777 3 года назад +4

      Same! So much so I just ordered a medium sized whiteboard on Amazon basics. I never realized how much of a difference learning things the "hard way" makes - writing each line of code and going through it line by line, as well as a healthy mental model to represent the concept etc.

  • @kewner8556
    @kewner8556 2 года назад +6

    So good. Not just a great explanation, but also told in an inspiring way. If only there was a whole web development course from Will!
    Just in case it's useful to anybody:
    0:00 Returning a function from a function
    15:04 Calling a function from inside the scope it was defined in
    20:14 Calling a function from outside the scope it was defined in
    42:03 Backpack/persistent lexical scope reference/closed over variable environment/closure
    45:46 Returning a function more than once
    51:41 Lexically scoped languages vs. dynamically scoped languages
    52:11 The power of closure

    • @Codesmith
      @Codesmith  2 года назад +1

      Super helpful thank you 🙏

  • @liammahoney1748
    @liammahoney1748 3 года назад +11

    This guy is really a special type of teacher

  • @petroszavrakas1109
    @petroszavrakas1109 2 года назад +4

    The ability of breaking down such a complex JS topics in small and simple steps and make them so easy to understand, its a charisma! Well done!
    Its the first time i watch an explanation of closures and i feel confident i 100% get it!

    • @Codesmith
      @Codesmith  2 года назад

      Thank you Petros! More videos soon

  • @youngkim3625
    @youngkim3625 2 года назад +1

    I've gotta say, Will Sentance is captivating and genuinely inspires curiosity. His passion really comes through when he teaches. Thank you so much for this video.

  • @kylelambert9576
    @kylelambert9576 4 года назад +7

    Your videos have taken my JavaScript and programming knowledge to a whole new level. This is hands down the best explanation of advanced JavaScript topics. I can't thank you enough! :)

  • @ankitvasita
    @ankitvasita 3 года назад +1

    I have watched tones of videos to understand hard parts of javascript but the way you explained these concepts is something that just clicks in my mind. Your teaching is on another level. keep it up.

    • @Codesmith
      @Codesmith  3 года назад

      Thanks Ankit - hopefully we'll do some more courses soon

  • @douglasrogers1601
    @douglasrogers1601 Год назад

    Wow, outstanding. Thank you. Closure = Persistent Lexical Scope Reference PLSR = Closed Over Variable Envionment COVE = 'Backpack'

  • @sideshowlol
    @sideshowlol 3 года назад +6

    I absolutely loved this step-by-step walkthrough. Thanks Codesmith and thank you, Will. Also, as I happened to be watching on a Sunday, I had a good laugh when Will asked, "Why on earth are we doing this on a Sunday?" :D

  • @samuelokoli6584
    @samuelokoli6584 2 года назад

    All the love from Nigeria...I have never been so happy to attend classes...this was superb

  • @sezif3157
    @sezif3157 2 года назад +4

    OMG this is an excellent class on javascript and an excellent class on how to teach correctly, both simultaneously. Awesome, thanks Will!

  • @poppyseeded3062
    @poppyseeded3062 2 года назад

    This video is gold! I was able to get through multiple closure problems after only watching a portion of the video!!

  • @nguyennguyen-dd8kz
    @nguyennguyen-dd8kz 3 года назад +2

    Your drawing helps explaining closure in a clearer way! Thank you so much!

  • @mahmoudhussein947
    @mahmoudhussein947 Год назад

    at last I can say that I fully understand closures , I really admire methodology of teaching and breaking down this complex topic 👏

    • @Codesmith
      @Codesmith  Год назад

      Thank you Mahmoud! Let us know other topics you want to hear about

  • @codellyson
    @codellyson 3 года назад

    The best javascript teacher out there. Much love and thanks for all you do.

  • @TibbyProductions
    @TibbyProductions 2 года назад

    Man, that backpack of data analogy is super helpful for understanding how closures work, thank you so much Will!

    • @Codesmith
      @Codesmith  2 года назад +1

      Thank you! Spread the word 😂

  • @lalosalamanca1208
    @lalosalamanca1208 2 года назад +2

    Wow. This is insanely helpful. Thank you so much for going into depth on this hard-to-comprehend subject within the "scope" of JS.

  • @headphonejames
    @headphonejames 9 месяцев назад

    This was a phenomenal lecture and a top notch teacher. Extremely grateful that this is shared.

    • @Codesmith
      @Codesmith  9 месяцев назад

      We are so glad it was helpful!!

  • @felipemelendez5741
    @felipemelendez5741 3 года назад

    Best closure explanation I have seen thus far; excellent, thanks!

  • @emate8422
    @emate8422 3 года назад +1

    Ive watched multiple video about clouseres and yours explenection is Great Thanks

  • @oanacristea2572
    @oanacristea2572 3 года назад

    One of the most complex js concepts explained so well. Thanks Will and Codesmith!!

  • @saidshahahmadi6975
    @saidshahahmadi6975 2 года назад

    The best explanation of Closures, thanks smith

    • @Codesmith
      @Codesmith  Год назад

      Of course! Happy to hear it was helpful!

  • @brucesmith1754
    @brucesmith1754 2 года назад

    Defining closures by way of understanding the background engineering.
    i really appreciate this approach to explaining these challenging concepts.
    Great job Will.

  • @macmaster9887
    @macmaster9887 2 года назад

    This is gem.. whole heartedly thankyou to codesmith.

  • @psk177
    @psk177 2 года назад

    You are an absolute LEGEND! Thank you so much Sir!

  • @markpowell8325
    @markpowell8325 2 года назад

    This is crazy good. By far the best tutorial I have ever seen.

    • @Codesmith
      @Codesmith  Год назад

      We are so happy to hear it was helpful!

  • @__prod1gy__793
    @__prod1gy__793 4 года назад +2

    Will is great,i like his workshops on frontend masters

  • @RocknRollDina
    @RocknRollDina 2 года назад

    Will is the best teacher ever!

  • @S0m0neRand0m
    @S0m0neRand0m 3 года назад +1

    Man, so happy I found this channel! You guys are all great, but especially you mister Will. Love the style, and I've always like the 'English accent' better than the American English 😉

    • @Codesmith
      @Codesmith  3 года назад +1

      Thanks Stijn - I can't deny I'm a fan of American accents above all else

  • @vusimdudu9033
    @vusimdudu9033 3 года назад

    Wow, that is the best explanation of closure I have ever heard, well done Sir.

  • @offday3523
    @offday3523 3 года назад +1

    so glad I found this! thank you Will!

    • @Codesmith
      @Codesmith  3 года назад

      Glad you enjoyed it!

  • @cannabisanomaly
    @cannabisanomaly Год назад

    I like to think this specific class that is involved with all of Will's lectures at this point in time is very similar to the class of students that was in the movie Dead Poets Society

  • @sanjusaju4049
    @sanjusaju4049 2 года назад

    The best explanation i have ever heard!!....

  • @salamander5969
    @salamander5969 Год назад +1

    What the f , the way you explain it using diagram makes me understand it better, and you explained the best context

    • @Codesmith
      @Codesmith  Год назад

      Thank you! Keep going with the workshops

  • @trunks7012
    @trunks7012 3 года назад +2

    only time i can ever remember wanting to like a video twice

    • @Codesmith
      @Codesmith  3 года назад

      haha - thanks so much 🙏

  • @mattisnumber6
    @mattisnumber6 3 года назад

    This is awesome. Great educator

  • @failureffect
    @failureffect 3 года назад

    So I'm slowly understanding a call back can access variables within its outer function. But what are some real-world uses of a closure in React/Angular/Vue?

  • @veggievera
    @veggievera 3 года назад

    Wow! This really cleared things up for me :)

  • @daizowatanabe5818
    @daizowatanabe5818 2 года назад

    How can I access the value of counter, say like, to console.log?

  • @dhoomketu731
    @dhoomketu731 2 года назад

    Will, I owe you a beer. Great stuff mate.

  • @gsmsalihou4505
    @gsmsalihou4505 4 года назад +1

    Very well thank Will

  • @professoroflogic8788
    @professoroflogic8788 4 года назад +4

    We need the posh parts of JavaScript.

  • @Behold-the-Florist
    @Behold-the-Florist 4 года назад +2

    I love this! 🙌🏽🙌🏽🙌🏽

  • @thomasnielsen7466
    @thomasnielsen7466 4 года назад

    what did the JS dev team actually call the closure when they made it?

  • @jiazhengguo5493
    @jiazhengguo5493 4 года назад +1

    awesome!!!

  • @user-XM6756
    @user-XM6756 2 года назад

    Talanted teacher!

  • @nickfan7867
    @nickfan7867 4 года назад +1

    Life saver!

  • @northstarcode8675
    @northstarcode8675 3 года назад

    When I first heard about "memoize", I thought it's a "memorize" in a Boston accent xD

  • @hqbop9058
    @hqbop9058 2 года назад

    Hi! I'm a student. I would appreciate it if you could help me with my homework. Thank u!