🔥 90% of you will fail to answer this simple JS Question - Does async await block JS main thread 🔥🔥?

Поделиться
HTML-код
  • Опубликовано: 14 янв 2025

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

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

    This question really killed my head when I first saw async and await, now it's clear, thank you for the video vasant🙌🙌❤❤

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

      Glad it helped .. join our telegram group here: t.me/uncommongeek

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

    Thanks I was also confused in this question in one of my past interview. Thanks for demostrating it

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

      Glad it was helpful! please share channel details with your friends !!

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

    Maja aa gaya sir , concept clear ho gaya....

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

    I need to admit that after completing your series, my approach has changed and the way I look at the code has changed and also I'm easily able to answer the coding outputs for most of the problems.
    Completed Revision of this series 😁

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

      Great to hear! Sateja, thanks for completing the series.

  • @yashgupta-rs9ro
    @yashgupta-rs9ro 2 года назад +1

    Can we say async function returns us a promise and "await" keyword blocks the function execution context ???

  • @allpeace1
    @allpeace1 10 месяцев назад +1

    Thanks for solving simple yet trickly interview ques

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

    The question does async/await block main thread came to my mind while I'm learning async/await. Thanks for clearing confusion.

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

      Thanks for commenting. In case if you not subscribed to my channel please subscribe and watch all my videos. Yes, this is quite confusing topic, even those candidates who have read this topic get confused in the interview. Good that you watched my video and learnt it fully.

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

    Nice video and thank you for clearing the concept. Just one thing plz mention that your nested promise approach and the await approach are not the same
    1. promise1().then( () => promise2().then( () => promise3.then( () => console("blah blah blah") ) ) )
    is not same as
    2.
    await promise1()
    await promise2()
    await promise3()
    as the second approach is faster because in 1. the promises wait for parent promise to finish and in 2. all the promises fire at once. So 2 is faster and promises are independent of each other.

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

      Thanks for commenting. In case if you not subscribed to my channel please subscribe and press the bell icon and watch all my videos and share the channel with your friends.
      Sorry Himanshu it took sometime for me to reply to your comments. Both are same,
      await promise1()
      await promise2()
      await promise3()
      Here promise2() will not be triggered until promise1() is completed. As the very word means await, main thread waits for the promise1() to complete before processing promise2().

  • @pushpabhandari8848
    @pushpabhandari8848 10 месяцев назад

    helpful !! thank you

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

    Wow thank you so much

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

    This is the basics of JS, if you don't know how JS engine works then you have a problem

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

      Appreciate the comments !! People climb the ladder, nobody is born genius. Basic to you may not be same for others !!

  • @as_if
    @as_if 7 месяцев назад +1

    Much needed

  • @IBRAHIMKHAN-bu3jc
    @IBRAHIMKHAN-bu3jc 2 года назад +1

    awesome

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

      Thanks for commenting. In case if you not subscribed to my channel please subscribe and press the bell icon and watch all my videos.

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

    crisp

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

    I failed to answer here 😜