JavaScript Visualized - Promise Execution

Поділитися
Вставка
  • Опубліковано 15 чер 2024
  • Learn about the inner workings of Promises in JavaScript and see how they enable non-blocking asynchronous operations.
    - / lydiahallie
    - buymeacoffee.com/lydiahallie
    - / lydiahallie
    - / lydia-hallie
    - / theavocoder
    Timestamps:
    0:00 - Intro
    0:19 - Promise Constructor
    4:42 - Chaining thens
    6:26 - Challenge
    8:05 - Outro

КОМЕНТАРІ • 437

  • @theavocoder
    @theavocoder  2 місяці тому +175

    ❤Hello again!! It's been a while since I uploaded to my own UA-cam channel haha.
    🔊 I'm aware that the audio is a bit low! Sorry about that, will keep this in mind in the future :)
    I have many ideas for upcoming videos, but let me know in the comments what you think I should cover next! 👇

    • @karthikm.1804
      @karthikm.1804 2 місяці тому

      "Yes! It's been a while, but I am excited for all the upcoming videos."

    • @markasena
      @markasena 2 місяці тому +2

      Volume is a bit low on my side. boost it up on your next one!

    • @EdwinMartin
      @EdwinMartin 2 місяці тому +2

      Hopefully not in 2029 😉

    • @mohithguptakorangi1766
      @mohithguptakorangi1766 2 місяці тому +3

      How did you create those slides of animations? Please let us know.

    • @hellomukit
      @hellomukit 2 місяці тому +4

      Great video. I would also like to know, how are those animations are made?

  •  2 місяці тому +126

    Probably the best explanation of Promise I've ever seen

  • @rodrigolj
    @rodrigolj 2 місяці тому +28

    I don't know if you want to go full time on this, but until then, I'm just so happy you decided to create content. It gives so much clarity on what JavaScript does, especially for people like me, who have aphantasia.

  • @dipeshtamang4467
    @dipeshtamang4467 Місяць тому +16

    Visualisation really makes any complex topic easier to understand. Awesome explanation, keep up the good work.

  • @pedroalmeida6728
    @pedroalmeida6728 2 місяці тому +58

    The visuals and animations are top notch, amazing work, keep it up!

  • @dbsSensei
    @dbsSensei 2 місяці тому +106

    Finally, new video after five years :')

  • @sunkittsui7957
    @sunkittsui7957 2 місяці тому +28

    This is the most well done and comprehensive video on JS Promises that I have seen so far!

  • @pablomendezjimenez2010
    @pablomendezjimenez2010 2 місяці тому +5

    Never seen a video with such clear drawings for explaining JavaScript promises and how they relate to the event driven nature of current JavaScript compilers.
    You've got a new subscriber!

  • @JohnBuildWebsites
    @JohnBuildWebsites Місяць тому +5

    One of the best explanations I've seen. I'm so glad to see in recent years far better communication of confusing or complex ideas in coding.
    As an older bearded autistic Linux fan myself, I can confidently say simple communication hasn't traditionally been one of my peer groups strengths 😂. So I am glad my daughter will have far better role models explaining these concepts if she chooses to go into software development.

  • @AngeloCarlotto
    @AngeloCarlotto 2 місяці тому +1

    The way you explain thing is just perfect form me, and the awareness of you saying “you understand OR how well I(your self) explained” means to me you are beyond of a heck of a person/professional. Good job.

  • @danielqolami
    @danielqolami 2 місяці тому

    This is the best explanation I've ever seen on "Promise" subject.
    thanks for the video.

  • @alexandrsashin
    @alexandrsashin 2 місяці тому +3

    Your illustrations are eye-catching and easy to understand. I like this approach and want to say "Thank you" for such a great video!

  • @umardevs
    @umardevs Місяць тому

    The visualization here is crazy to a point, me- who's very slow to understand, understood every word you said. Please keep doing more of this. I've even subscribed!

  • @BonBaisers
    @BonBaisers 2 місяці тому

    Love it, strait to the point, useful infographics and efficient plan. I think the format is great. Details on "small" topics give the opportunity to beginners understand concepts and experimented people will always learn 1 or 2 things.

  • @sanzhar.danybayev
    @sanzhar.danybayev 2 місяці тому

    That's one of the most brilliant explanations I've ever seen. And the best visualization so far!

  • @David-yx8ks
    @David-yx8ks 2 місяці тому

    Great video and one of the best illustrations of promises I’ve ever seen. Please continue making this type of content!

  • @tobiashaefermann
    @tobiashaefermann 2 місяці тому +3

    Great video as usual! A tiny addition I would make is that the then handler implicitly creates a fulfilled Promise as shown in the video by Lydia if you return a plain value - but the more common case for chaining is that you explicitly return a Promise yourself which usually is pending at first.

  • @fanyinU
    @fanyinU 14 днів тому +1

    Wow 🚀 This is the BEST explanation of promise concept I've ever seen. The visualization and your explanation work super well together 👍

  • @ikshitchaudhari2529
    @ikshitchaudhari2529 2 місяці тому +1

    WOW, this is some really high quality content.
    Can definitely see your channel skyrocketing !
    Keep up !🔥

  • @slackstation
    @slackstation 2 місяці тому

    Excellent video. The animations add so much to the understanding!

  • @TheCodingSloth
    @TheCodingSloth 2 місяці тому +5

    wow amazing video Lydia! Really loved the high quality visuals and your teaching style. Keep it up!

  • @A_Saban
    @A_Saban 2 місяці тому +2

    Well done! this visualization is the best I have ever seen for learning how the code works, plus your explanation is easy to understand kinda whish I had it when I learned promises

  • @novodip247
    @novodip247 2 місяці тому

    I have a frontend interview after 2 days and this popped up in my feed, thanks youtube, Great visualization of promise, really enjoyed how you explained how things work under the hood in Promise.

  • @arsamhashempour8156
    @arsamhashempour8156 19 днів тому

    just 2 days ago I was thinking about lack of a visualized teaching in javaScript and today I found this channel it's great keep going and keep the level of your videos above I think developer community needs more people like you

  • @heayyyyyyy11
    @heayyyyyyy11 Місяць тому +1

    Finally someone could explained how this whole magic is working in the way I can understand. Thank you so much :D

  • @akashrajawat3676
    @akashrajawat3676 2 місяці тому

    Just WOW!!!
    I have seen dozens of videos on Event Loop, and it made sense to me because some of them does not explain complete event loop. There is a famous video which tells event loop is simply a Stack and a Queue, and which always confused me when working with callbacks or promises. Thankyou very much for the video and looking forward for topics like "Closure".

  • @abhirajsinha3186
    @abhirajsinha3186 2 місяці тому

    Have been reading your Javascript Visualised series on Medium, you're really underrated. Thank you for making these, hope you continue! Really helpful for beginners

  • @jason17493
    @jason17493 2 місяці тому

    Brilliant work!!, explained easily with story + visualizations, thanks Lydia. I hope u continue to make such Visualized videos for advanced concepts for key frontend techs such as JS, TS, ReactJS and NodeJS.

  • @omak3313
    @omak3313 2 місяці тому +1

    Thank you, Lydia! Visual explanation with animation helps a lot in understanding!

  • @l0upgarou
    @l0upgarou 2 місяці тому +1

    Lydia, I wish I could like and subscribe more than once. Love this format, please please make more videos like this.

  • @proplayeriguess
    @proplayeriguess Місяць тому

    this is the best explanation i have ever seen, simply awesome

  • @AMMullan
    @AMMullan 2 місяці тому

    Superbly explained - as someone who hasn't really done much JS for a while and wanting to get back into it these kind of clearly explained resources are so useful 👏⭐

  • @stianmaurstad
    @stianmaurstad 2 місяці тому

    Thank you Lydia, as a visual learner, these visuals makes it so much easier!

  • @julia-vialkova
    @julia-vialkova Місяць тому

    Lydia, thank you very much for explanation. Don't stop, keep making videos like this

  • @kh0lis
    @kh0lis 2 місяці тому +2

    This video suddenly popup on my feed. Your explanation with visualization is outstanding. Hope you can continue with other topics. Thanks 👍

  • @agormanco
    @agormanco 2 місяці тому

    Nicely done! I've working with Promises since 2012 or before, but I never understood the details until watching your video in prep for an interview. Thanks!

  • @macmacmac740
    @macmacmac740 2 місяці тому

    Amazingly explained. Thank you very much.
    I am in between interviews and I am sure this video will help me explain and implement promise in most effective way. ❤

  • @Athelian
    @Athelian Місяць тому +2

    I was blown away by your frontend masters course, please make more content like this and don't change a thing!

  • @dmitrystril1748
    @dmitrystril1748 2 місяці тому

    Hey, it's good to see you on youtube, your visualizations got even better! 😀
    Thanks!
    💡Maybe execution contexts and closures would be good to cover next.

  • @libra.
    @libra. 2 місяці тому +1

    been waiting for 5 years, ‼️🗣️🗣️🗣️ legit firee🔥🔥🔥💯💯

  • @user-ck6yl6qb2g
    @user-ck6yl6qb2g 2 місяці тому

    By far the best explanation of this topic I've even seen

  • @g_pazzini
    @g_pazzini Місяць тому

    the visualizatiion is neatly created and helps a lot to understand the concept explained. great job!

  • @AjinkyaBhushan
    @AjinkyaBhushan 2 місяці тому

    You are doing amazing. Keep posting videos. I understood about promises clearly

  • @noobatprogramming6777
    @noobatprogramming6777 2 місяці тому

    Love the video. Please make video like these more. Also the test your knowledge thing at the end was amazing. Would love to see more of this.

  • @ilejovcevski79
    @ilejovcevski79 20 днів тому

    This was extremely helpful, i hope you keep on making these!

  • @plabmadeeasy
    @plabmadeeasy 2 місяці тому

    Those are some beautiful animations! Thanks for the video!

  • @PostigIT
    @PostigIT 2 місяці тому

    Asynchronous programming is one of the most difficult topics to learn for beginners, because it is difficult to visualize in your head the coherent work of the stack, queues, event loop and web API. Thank you for such a clear explanation of how Promises work. I'm waiting for your new videos. Greetings from Russia! 🕊

  • @burhanuddinkauka792
    @burhanuddinkauka792 Місяць тому +1

    Please please continue this series this is so awesome ❤

  • @nope-zdvcz99
    @nope-zdvcz99 13 днів тому

    probaly one of the best explanation for Promise, thank you so much for this video🙏

  • @dylanpalmboom2971
    @dylanpalmboom2971 17 днів тому

    Thanks for another amazing video! This cleared up many questions I had in my mind regarding asynchronous code ✨

  • @jizhang2407
    @jizhang2407 2 місяці тому

    I love the visualization. Thank you. And, more, more, more...!

  • @LukasSmith827
    @LukasSmith827 2 місяці тому

    learning through both visualization and text is so underrated. please keep these videos going!

  • @tahasin2321
    @tahasin2321 2 місяці тому

    Finally welcome back after five years with new video ❤❤❤

  • @alessandroformica6824
    @alessandroformica6824 Місяць тому

    Learning is fun this way! Looking forward to subscribing to one of your next courses ❤

  • @nate_codes
    @nate_codes 2 місяці тому +4

    This was INSANELY well done and highly educational. As someone who felt like I never fully grokked promises, after 4mins of watching a vid I now feel confident in how they fundamentally work. The visuals were amazing, progressive code snippets were perfect, and the script was tight and educational. I love that you basically made a clif notes video for a chunk of EXMA-262!! Insta sub! 👏

    • @nate_codes
      @nate_codes 2 місяці тому

      EMCA-262… DYAC 🤦‍♂️

    • @lilichao9984
      @lilichao9984 Місяць тому

      @@nate_codes ECMA?

  • @mihirphadnis2
    @mihirphadnis2 7 годин тому

    I am so glad this popped up in my timeline. Thank you for this great video!

  • @kdshare6765
    @kdshare6765 2 місяці тому

    Excellent, I am very glad to watch this high quality video ❤

  • @josemarin359
    @josemarin359 2 місяці тому

    Really good video. Even though youtube is crowded with Language specific subjects, the quality of this video makes it special.
    What I don't see a lot in youtube (maybe you can take the challenge) is about programming developing flow and techniques. Once you master the language the big challenge is about the developing process flow. How to decompose a big problem. Where to start. When to be wary about coupling of functions and data structures, how to create functions that have only one responsibility, data structures, simplicity, scope of a function, top-down approach vs bottom-up approach. I think the format for the video could be to create a medium complex project (several videos) and stress good practices and what could have gone wrong, what are the internal thought process that recreated the flow.

  • @chairlovawitabat
    @chairlovawitabat 2 місяці тому

    Thank you so much for the visual. For a second video, the quality is insanely good. If you have a visual of the call stack/web API/task queue/event loop visual in png or jpg format, that’d be sooo sick. 🙏🙏🙏
    Some ideas I think would be cool to cover :
    • I/O with node
    • traversing the DOM with browser JavaScript
    • covering the newest JS methods (one that mutates arrays vs those that don’t).
    • browser fetch and accessing the response data
    • top level await, where it works and where it doesn’t
    • asynchronous importing
    Advanced stuff that would personally help me:
    • ESModules vs CommonJS
    • path aliasing in typescript and having a JS path resolution solution as well
    • JSDoc.
    • declaration files in typescript
    • web workers
    This video is so good, I immediately subscribed. I can already tell you’re chock full of knowledge. 🙏🙏🙏

  • @lakshminarayanareddypadart9807
    @lakshminarayanareddypadart9807 2 місяці тому

    Please make more videos like this. It makes my learning faster and easier.

  • @KuvitusAcadamy
    @KuvitusAcadamy Місяць тому

    Great tutorial! I really appreciate the clear explanations and visualizations you provide for JavaScript concepts. I think it would be awesome if you expanded your tutorials to cover other programming languages using the same visualization method. It could help learners understand different languages more easily and broaden their skillset. Keep up the excellent work!

  • @ankitsenjaliya1808
    @ankitsenjaliya1808 Місяць тому

    This video is a master piece.Thanks for your detailed explanation.

  • @jorsisu
    @jorsisu 2 місяці тому

    Is nice to see you back. These animations remind me of Delba's videos but well-colored and longer. This is great content!😁

  •  2 місяці тому

    Great video and probably one of the best explanation of promises on the web. Thank you.

  • @meowmerry5418
    @meowmerry5418 21 день тому

    Please continue more, your video makes me understand and it really help me to want to study more.

  • @nataliabenko6579
    @nataliabenko6579 2 місяці тому

    Loved the visualisation, it really helped to understand and follow along.
    Thank you!

  • @_dp3po_881
    @_dp3po_881 2 місяці тому

    best explanation I've ever seen. well done.

  • @laracombina
    @laracombina 2 місяці тому

    Your animations are beautiful, thank you so much 💞

  • @MikeNugget
    @MikeNugget 2 місяці тому +1

    Wow, that infographics animation is absolutely amazing ❤

  • @user-qg6cr7tk2b
    @user-qg6cr7tk2b 2 місяці тому

    Thanks for uploading this video. Actually when I stated learning JS , I read your writing on MDN about " Promises & Async/Await" then I came to UA-cam if there is any video on this but it was not there. I got a bit disappointed. Now You upload this video. really happy for that. please make more video on JS.

  • @maryembenyounes523
    @maryembenyounes523 2 місяці тому

    This is the best Promise video i've seen and i've seen many. Keep going ❤

  • @Serhat786
    @Serhat786 2 місяці тому

    Welcome back and try again and never give up. Happy to see.

  • @aliajellu
    @aliajellu Місяць тому

    Incredibly well done video. thank you!

  • @sirhcleunam
    @sirhcleunam 2 місяці тому

    Nice!! Very interesting explanation with video animation, it's easy for a newbie like me to understand. Thank you!

  • @theavocoder
    @theavocoder  2 місяці тому +18

    💡Also just a little clarification since I simplified the chained thens, I should've made this more clear by adding the event loop animation here as well!
    The first promise constructor resolves, the first then handler is encountered, this handler is immediately added to the microtask queue. However, the callstack isn't empty at this point because there are more thens to handle. So it keeps creating Promise Reaction/Promise Object records for the subsequent thens and these are added to the fulfill reactions list, but they aren't fulfilled at this point since the first handler is still waiting on the microtask queue. Only when the callstack is empty would this resolve and add the next then's handler to the microtask queue.

    • @mohithguptakorangi1766
      @mohithguptakorangi1766 2 місяці тому +1

      How did you create those slides of animations? Please let us know.

    • @nikeshsingh3049
      @nikeshsingh3049 2 місяці тому

      How did you create slides and animations. Would be great help

  • @salehmohammednasseralobidi5880
    @salehmohammednasseralobidi5880 24 дні тому +1

    What a wonderful explanation 😊😊

  • @Gazwai92
    @Gazwai92 2 місяці тому

    The visualisations are great, one of the better explanations around promises 👍

  • @anon5992
    @anon5992 Місяць тому

    I'm so happy this video exists! I've seen many courses that cover this topic but this one has been the most complete the easiest to understand. please teach us more, can i ask for how heap works in javascript video

  • @DouglasGubert
    @DouglasGubert 2 місяці тому

    Awesome visualization! Makes the concept so much easier to grasp :)

  • @ricTGL
    @ricTGL 2 місяці тому

    Hello Lydia! This video was super useful to me! It is always the same, you think you know something until someone shows you that you don't with fancy animations!
    My two cents on how to improve (it was a super good video btw): Felt that you went a bit fast though, and even though the animation was almost always clear there were sometimes I had to pause and go back to kind of understand what was going on. Other than that, I missed a bit extra explanation on what the call stack, event loop and so on are. Might be a good idea that you make a video on that so you can reference that one in future videos.
    Keep going, you're doing great!

  • @theavocoder
    @theavocoder  2 місяці тому

    📝 Blog Post: www.lydiahallie.com/blog/promise-execution
    📚 ECMA spec: tc39.es/ecma262/#sec-promise-objects
    👩‍🏫 Check out my JavaScript Visualized Course on FrontendMasters! frontendmasters.com/courses/javascript-quiz/

  • @nestorrente
    @nestorrente 2 місяці тому

    I've found this video quite interesting! I already had more or less a clear idea of how promises work, but honestly I didn't know the existence of the microtask queue (I thought all future tasks were added to the same queue). I'll share this video with the developers of my team so they can learn from you too 🙂 thanks for this!

  • @CoreDumpped
    @CoreDumpped 2 місяці тому

    What a great video. I loved the animations!

  • @lottexy
    @lottexy 2 місяці тому

    holy damn finally!! i remember reading ur posts, glad to see you have videos

  • @cisolarix
    @cisolarix 2 місяці тому +2

    Without your video, I had never even been close to fully understand how promise works under the hood.

  • @diegoorellana8947
    @diegoorellana8947 2 місяці тому

    please keep doing these deep and technical videos!
    Also, it would be nice if at the end of the video, you give some recommendations on resources to learn more about the topic being touched.

  • @quofintech9200
    @quofintech9200 2 місяці тому

    Great video Lydia, thanks!

  • @metric152
    @metric152 2 місяці тому

    this did a really good job breaking down a complex sequence of operations. good video.

  • @rajatpatel1148
    @rajatpatel1148 2 місяці тому

    Your github repo for javascript is so famous. It is so great to see you on youtube.
    Goodluck 😊❤️💯

  • @xdasdaasdasd4787
    @xdasdaasdasd4787 2 місяці тому

    Made a lot of sense, great visuals too

  • @danielwilkowski5899
    @danielwilkowski5899 Місяць тому

    top-notch, 10/10, very high quality content. instant subscribe.

  • @naoufaljrh3891
    @naoufaljrh3891 2 місяці тому

    please keep doing this, this is just great !

  • @CrusaderMen
    @CrusaderMen 2 місяці тому

    Thank you
    Learning by visual is the best way to learn

  • @stevensmith5626
    @stevensmith5626 2 місяці тому

    Wow!!!! Best explanation of a Promise I’ve ever seen! I think I dented my iPad hitting the like button so hard 😂. Keep up the good work. Well, better subscribe 😊

  • @DanPlayPl
    @DanPlayPl 2 місяці тому

    For far best explanation of promises i've seen

  • @kevinjust4517
    @kevinjust4517 2 місяці тому

    Thank you, this was very helpful 🙏

  • @sumantramukherjee2064
    @sumantramukherjee2064 Місяць тому

    So lucid explanations! Thanks much. 😊😊

  • @favourisrael7819
    @favourisrael7819 Місяць тому

    really love your work

  • @maheshOffVlogs
    @maheshOffVlogs 2 місяці тому

    Hey welcome back after 1/2 decade 😍,nice explanation came back with cool video. Plz continue doing videos 🫶

  • @satyam3480
    @satyam3480 8 днів тому

    beauty with brains personified....great explanation.