JavaScript Visualized - Promise Execution

Поділитися
Вставка
  • Опубліковано 28 лис 2024

КОМЕНТАРІ • 529

  • @theavocoder
    @theavocoder  8 місяців тому +217

    ❤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 8 місяців тому +1

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

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

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

    • @EdwinMartin
      @EdwinMartin 8 місяців тому +3

      Hopefully not in 2029 😉

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

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

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

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

  •  8 місяців тому +210

    Probably the best explanation of Promise I've ever seen

  • @pablomendezjimenez2010
    @pablomendezjimenez2010 8 місяців тому +14

    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!

  • @rodrigolj
    @rodrigolj 8 місяців тому +52

    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.

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

    I started programming (BASIC on my APPLE ][+) in 1983 and have been in IT professionally for 25 years and I think your videos are amazing. Your explanations and visualisations are probably the best I've seen on UA-cam!

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

    I have been working on JS for like 2.5 Years now, so far I worked only by doing "MONKEY SEE MONKEY DO" way, but now finally I have understood how promises actually works. Best explanation on earth.
    Watched multiple other tutorials but it was never clear not even close to what was explained in this video. Thanks a lot ma'ma.

  • @pedroalmeida6728
    @pedroalmeida6728 8 місяців тому +73

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

  • @dbsSensei
    @dbsSensei 8 місяців тому +113

    Finally, new video after five years :')

  • @sunkittsui7957
    @sunkittsui7957 8 місяців тому +32

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

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

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

  • @vagrawa1
    @vagrawa1 4 місяці тому +1

    Hello Lydia. Thanks for all the videos. I hope we have teachers like you everywhere. Watching your videos gives so deep understanding about the topics. Thanks you so much again!!!

  • @arsamhashempour8156
    @arsamhashempour8156 6 місяців тому

    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

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

    I paid many JavaScript courses on Udemy and none had content like Lydia. I just have to subscribe to this channel.

  • @theavocoder
    @theavocoder  8 місяців тому +24

    💡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 8 місяців тому +2

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

    • @nikeshsingh3049
      @nikeshsingh3049 7 місяців тому

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

  • @dipeshtamang4467
    @dipeshtamang4467 7 місяців тому +19

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

  • @JohnBuildWebsites
    @JohnBuildWebsites 7 місяців тому +6

    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.

  • @tobiashaefermann
    @tobiashaefermann 8 місяців тому +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.

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

    it's the best video on promises, visualization will always make concept crystal clear and you nailed it.

  • @TheCodingSloth
    @TheCodingSloth 8 місяців тому +6

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

  • @PloddingDream-px3fz
    @PloddingDream-px3fz 12 днів тому

    This is a flawless presentation. I haven't found a single resource even mentioning the promise reaction record.

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

    Found your channel from GreatFrontend. This is the best Promise explanation on the internet. The animations are top notch 🔥🔥

  • @burhanuddinkauka792
    @burhanuddinkauka792 6 місяців тому +2

    Please please continue this series this is so awesome ❤

  • @letmewatch.
    @letmewatch. 6 місяців тому

    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!

  • @alexandrsashin
    @alexandrsashin 8 місяців тому +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!

  • @akashrajawat3676
    @akashrajawat3676 7 місяців тому

    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".

  • @Athelian
    @Athelian 7 місяців тому +2

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

  • @nate_codes
    @nate_codes 8 місяців тому +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 8 місяців тому

      EMCA-262… DYAC 🤦‍♂️

    • @lilichao9984
      @lilichao9984 7 місяців тому

      @@nate_codes ECMA?

  • @AMMullan
    @AMMullan 7 місяців тому

    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 👏⭐

  • @Bhanuprasad-r3n
    @Bhanuprasad-r3n 2 місяці тому

    One of the best explanation about promises

  • @fanyinU
    @fanyinU 6 місяців тому +1

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

  • @heayyyyyyy11
    @heayyyyyyy11 7 місяців тому +1

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

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

    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.

  • @novodip247
    @novodip247 8 місяців тому

    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.

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

    had to slowdown a video for the first time on yt instead of watching on 1.5x. Great work!

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

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

  • @muhammadusmanshaikh
    @muhammadusmanshaikh 3 місяці тому

    This type of explanation is the best. Please keep uploading.

  • @PostigIT
    @PostigIT 8 місяців тому

    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! 🕊

  • @A_Saban
    @A_Saban 7 місяців тому +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

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

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

  • @abhirajsinha3186
    @abhirajsinha3186 8 місяців тому

    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

  • @danielqolami
    @danielqolami 7 місяців тому +1

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

  • @RonnieDenzel
    @RonnieDenzel 19 днів тому +1

    Just found a new channel to subscribe to,these explanations are a solid💯

  • @lakshminarayanareddypadart9807
    @lakshminarayanareddypadart9807 8 місяців тому

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

  • @BonBaisers
    @BonBaisers 8 місяців тому +1

    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.

  • @praisechinonso-s8d
    @praisechinonso-s8d 4 місяці тому +1

    Your channel is a gem

  • @אלעדר
    @אלעדר 7 місяців тому

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

  • @AntonKononov-u5n
    @AntonKononov-u5n Місяць тому

    The best explanation I've ever seen! Thank you.

  • @LukasSmith827
    @LukasSmith827 8 місяців тому

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

  • @agormanco
    @agormanco 7 місяців тому

    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!

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

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

  • @proplayeriguess
    @proplayeriguess 6 місяців тому

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

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

    You have given an excellent explanation with great visualisations. Thank you!

  • @Serhat786
    @Serhat786 7 місяців тому

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

  • @dmitrystril1748
    @dmitrystril1748 7 місяців тому

    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.

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

    Wow, that infographics animation is absolutely amazing ❤

  • @Maelton_Lima
    @Maelton_Lima 6 днів тому

    Excellent content and explanation, congratulations for your work!

  • @vikashnagar2114
    @vikashnagar2114 4 місяці тому

    i just love you , mam
    i never get that kind of quality, deep knowledge about js

  • @nope-zdvcz99
    @nope-zdvcz99 5 місяців тому

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

  • @josemarin359
    @josemarin359 7 місяців тому

    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.

  • @ИванРагозин-я8я
    @ИванРагозин-я8я 7 місяців тому

    I love you Lydia, make more videos like this, the views, likes are incredible.

  • @shivams417
    @shivams417 8 місяців тому

    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.

  • @julia-vialkova
    @julia-vialkova 6 місяців тому

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

  • @tahasin2321
    @tahasin2321 8 місяців тому

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

  • @_dp3po_881
    @_dp3po_881 8 місяців тому

    best explanation I've ever seen. well done.

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

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

  • @jizhang2407
    @jizhang2407 8 місяців тому

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

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

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

  • @mihirphadnis2
    @mihirphadnis2 5 місяців тому

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

  • @MihirMenon-c4u
    @MihirMenon-c4u 3 місяці тому

    Thanks for deep explanation, Lydia

  • @salehmohammednasseralobidi5880
    @salehmohammednasseralobidi5880 6 місяців тому +1

    What a wonderful explanation 😊😊

  • @CrusaderMen
    @CrusaderMen 8 місяців тому +1

    Thank you
    Learning by visual is the best way to learn

  • @g_pazzini
    @g_pazzini 7 місяців тому

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

  • @stianmaurstad
    @stianmaurstad 8 місяців тому

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

  • @dustingarner4620
    @dustingarner4620 4 місяці тому

    This was so helpful, thank you so much for making this! The visuals were amazing.

  • @meowmerry5418
    @meowmerry5418 6 місяців тому

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

  • @DanPlayPl
    @DanPlayPl 8 місяців тому

    For far best explanation of promises i've seen

  • @WbAzmul
    @WbAzmul 8 місяців тому

    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.

  • @KuvitusAcadamy
    @KuvitusAcadamy 7 місяців тому

    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!

  • @lucasviga12
    @lucasviga12 3 місяці тому +1

    an explanation about: call stack and memory heap, or prototypes chain will be cool. Thanks for the video.

  • @plabmadeeasy
    @plabmadeeasy 8 місяців тому

    Those are some beautiful animations! Thanks for the video!

  • @flavisff8040
    @flavisff8040 3 місяці тому +1

    it helped a lot to revise and clear some doubt, thanks for such good content, keep making for some more topic ❤❤

  • @jorsisu
    @jorsisu 8 місяців тому

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

  • @CoreDumpped
    @CoreDumpped 8 місяців тому

    What a great video. I loved the animations!

  • @zardokar
    @zardokar 8 місяців тому

    I'm JS Developer and I like your animation for explanation. I hope you create the next videos. Cheer !!

  • @chairlovawitabat
    @chairlovawitabat 8 місяців тому

    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. 🙏🙏🙏

  • @maryembenyounes523
    @maryembenyounes523 7 місяців тому

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

  • @nestorrente
    @nestorrente 8 місяців тому

    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!

  • @TheUnknownFactor
    @TheUnknownFactor 7 місяців тому

    Incredible! I was playing-pausing-testing-playing-pausing as the video went on and ended up writing:
    function createHandler() {
    console.log('creating success handler');
    return () => console.log('.then Resolved!');
    }
    new Promise((resolve, reject) => {
    console.log('promise function body');
    queueMicrotask(() => console.log('microtask before resolve'));
    resolve();
    queueMicrotask(() => console.log('microtask after resolve'));
    }).then(createHandler());
    console.log('regular call stack');
    Before the last part of the video I expected ".then Resolved" to occur before "microtask after resolve"; but the last bit about then-handler not being pushed to the microtask queue until the then actually runs kind of makes sense. I was assuming that the resolve itself would push the microtask.

  • @717deorajgope4
    @717deorajgope4 2 дні тому

    best lecture on promises 🫡🫡

  • @rajatpatel1148
    @rajatpatel1148 8 місяців тому

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

  • @mohammadsubhan1318
    @mohammadsubhan1318 4 місяці тому

    You really explained it very well 🎉❤ Hats off

  • @SankarshanGhosh
    @SankarshanGhosh 5 місяців тому

    The promise pun at the start made me subscribe!

  • @ilejovcevski79
    @ilejovcevski79 6 місяців тому

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

  • @anon5992
    @anon5992 6 місяців тому

    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

  • @capability-snob
    @capability-snob 8 місяців тому +2

    Thank you, for this perfectly encapsulated lesson!
    Edit: Just realised Lydia already made a comment addressing the bug described below. Rest of original comment below for posterity.
    You clarify this in "Challenge", but the order does not appear correctly in "Chaining Thens": all 4 promises are created before the first lambda is run. The A+ spec guarantees that there's nothing but platform code on the call stack when a "then" is run, preventing a range of stale stack frame / unexpected concurrency bugs.

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

    very high level of presentation, as usual - thanks :-)

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

    Love the way you explained

  • @alessandroformica6824
    @alessandroformica6824 7 місяців тому

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

  • @diegoorellana8947
    @diegoorellana8947 8 місяців тому

    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.

  • @AR7editing
    @AR7editing 8 місяців тому

    I watched your course on Frontend Masters, 10/10.