Async / Await - Javascript In Depth

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 พ.ย. 2024

ความคิดเห็น • 30

  • @randerins
    @randerins ปีที่แล้ว +12

    Hands down the best content about this topic on TH-cam. Super clear!

    • @TechWithNader
      @TechWithNader  ปีที่แล้ว +5

      Thanks! That’s quite the statement haha! 😊 It’s a tricky but centra concept to JS so I’m glad I can help make it clearer for the community 🥳

  • @حسنزال-ي7ح
    @حسنزال-ي7ح 7 หลายเดือนก่อน

    I haven't started watching it yet but my guts tells me it is gonna be helpfull.

  • @MikeCzak87
    @MikeCzak87 ปีที่แล้ว +3

    Nader, you are doing an outstandingly good job explaining with clarity and structure. Thanks for the great content, I instantly subscribed. :)
    One advice for improvement that is not code related:
    Try to mount an external webcam on a stand that is not affected by your hand/body movement. When watching you talk on fullscreen, the little shakes make the viewer dizzy really quickly. I can only speak for myself of course. :)

  • @Proton_uio
    @Proton_uio ปีที่แล้ว +3

    Both the plain vanilla promises and async/await have pros and cons. The best way is for us to get the foundations down on both in order for us to be aware when or when not to use this or the other. I guess async/await is becoming more popular since it is cleaner, I guess? And is easier to handle such errors that may come along with a simple try catch wrapper instead of chaining multiple .then function. I suppose promises are older, so they still been used on many programs so compatibility is one thing. I believe by learning more about these two and kinda wrap the cons and pros will give us the best possible way on how to work on our code. Further, I suppose we can also combine them whatever is appropriate, MDN and Google is always there to further search on these advance topics, but I am super glad of this lecture.

  • @nanlunglongtau2076
    @nanlunglongtau2076 8 หลายเดือนก่อน

    Learning new stuff in the language feels great

  • @MoneyMaker-pu1rj
    @MoneyMaker-pu1rj 6 หลายเดือนก่อน

    watching your playlist. Better than Udemy BS courses.

  • @soysaucedaddy7520
    @soysaucedaddy7520 2 ปีที่แล้ว +6

    I appreciate these in depth, man. You planned and paced them out very well!
    Can't wait for project. I would love in depth nodeJS/ express as well.
    Have you thought about front end framework indepth yet? React/Vue would be great videos to cover.

    • @TechWithNader
      @TechWithNader  2 ปีที่แล้ว +3

      Thanks! I have pretty much all you described planned, haha! Will be going a bit deeper in to some JS, then I’ll bring in some front end/browser topics before moving to full stack and backend topics like APIs and databases etc. Too many topics, too little time! 😄

  • @timothyrees6318
    @timothyrees6318 ปีที่แล้ว +2

    Great content! You break down complicated concepts in such a clear and understandable way! You're a fantastic teacher! Awesome! :)

  • @liluminlalabai3736
    @liluminlalabai3736 2 หลายเดือนก่อน +1

    5:18 apart from this I think you Callback Functions has never been mentioned in this series, I noticed in NPM video you had Angular package installed, are you planning to make series for Angular 18-19 as well? Thanks @TechWithNader

  • @kinrev6719
    @kinrev6719 ปีที่แล้ว +2

    Well done!! God Nader, thanks for this nice explanation!

  • @senniagordinskaya4051
    @senniagordinskaya4051 4 หลายเดือนก่อน

    Thank you!

  • @bijay_magar5964
    @bijay_magar5964 2 ปีที่แล้ว +3

    You should do more exercises on projects which could be based on real life projects ! Anyway amazing video❣❣❣ Love from Nepal

    • @TechWithNader
      @TechWithNader  2 ปีที่แล้ว +5

      Hey Bijay, thanks for the kind words! I 100% agree and that’s the plan when we learn a few more concepts that will allow us to work with real life data (like promises and some other newer js syntax). Can’t wait to do those - already have lots of fun ideas! 🥳

  • @Six5
    @Six5 ปีที่แล้ว +2

    Nader this was amazing holyyy!!! learned so much thank you for the great content.
    I did some tinkering and got the .catch to work on the await so that a try/catch wasn't needed.
    const result = await makeTimeout(3000).catch((rejector) => {
    return rejector;
    });
    console.log(result);
    I know you said we don't have a way to catch errors with async/await other than the way you showed. Why does this work, is it a bug or very unstable or something?

    • @TechWithNader
      @TechWithNader  ปีที่แล้ว +1

      Great question! in this case, makeTimeout will return a promise and since it's a promise, we can still use .catch on it. So you can think of this basically doing this:
      makeTimeout(3000).then((result) => console.log(result)).catch((rejector) => rejector);
      Hope that helps :)

    • @Six5
      @Six5 ปีที่แล้ว +1

      @@TechWithNader ahh okay I see so it acts as a normal promise.

  • @randerins
    @randerins ปีที่แล้ว +4

    Honestly, I prefer the vanilla Promise syntax so far. I hope that changes on the exercises section

    • @TechWithNader
      @TechWithNader  ปีที่แล้ว +1

      Haha, let us know if that thought changes after you try these 😂

    • @randerins
      @randerins ปีที่แล้ว +2

      @@TechWithNader After exercise 3, I've got to see what a "callback hell" looks like.
      Glad I'm getting used to the async/await syntax 🙂

    • @TechWithNader
      @TechWithNader  ปีที่แล้ว +1

      @@randerins 😂🥳

  • @Abulkhair1995
    @Abulkhair1995 ปีที่แล้ว +1

    nice one

  • @soundwave-musicstudio6724
    @soundwave-musicstudio6724 ปีที่แล้ว +5

    Hi Nader, I learned a lot from your video tutorials, easy to understand. Can you please make a video about DOM Structure? new subscriber here. Thank you...

    • @TechWithNader
      @TechWithNader  ปีที่แล้ว +1

      Thanks a lot! Right after we look at Classes and OOP we'll wrap up the Javascript In Depth series and move right to the DOM In Depth 😊 (then React after)

  • @paljinder3
    @paljinder3 2 ปีที่แล้ว +3

    understandable super 👍Thanks!

    • @TechWithNader
      @TechWithNader  2 ปีที่แล้ว +1

      Thanks Paljinder! You’re very welcome - glad it was helpful 😊

  • @EliHacıyev-p7v
    @EliHacıyev-p7v 5 หลายเดือนก่อน

    You super master

  • @KRAKENBACK..
    @KRAKENBACK.. 9 หลายเดือนก่อน

    I noticed if u had a console.log before the console.error inside of the catch,
    try {
    console.log('sup sis')
    const result = await makeTimeout(2000)
    console.log(result)
    console.log('nah jk')
    } catch (error) {
    console.log('sup bro");
    console.error(error)
    }
    and you had code outside
    console.log('start')
    causeError();
    console.log('end')
    the output would differ from the resolved-try block because the order of outputs are different.
    // the log order
    start
    finish
    sup dude
    there was an error!
    the sup dude and error log comes after start and finish
    but in the case of the try block and resolved promise the order looks like
    //the log order
    start
    sup sis
    finish
    All done
    nah jk
    my question is why doesn't 'sup dude' log before 'finish' in the catch block, like 'sup sis' logs before 'finish' in the try block?