Asynchronous JavaScript in ~10 Minutes - Callbacks, Promises, and Async/Await

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 มิ.ย. 2024
  • The asynchronous nature of JavaScript to understanding the language. You'll find the use of callbacks, promises, and async/await in code that you write every day as a JavaScript developer. In this JavaScript tutorial, you'll learn about all three in about 10 minutes.
    00:00 - Intro
    01:15 - Callbacks
    03:20 - Error First Callback
    05:00 - Promises
    10:00 - Async/Await
    ____________________________________________
    Newsletter 🗞
    Interested in exclusive content and discounts? 🤯 Sign up for the newsletter!
    www.jamesqquick.com
    _____________________________________________
    Connect with me 😀
    Live streams on Twitch - / jamesqquick
    Follow me on Twitter - / jamesqquick
    Join the 💬 Discord Server 💬 - / discord
    _____________________________________________
    COURSES 💻
    Learn how to build Fullstack apps with React and Serverless Functions - www.jamesqquick.com/courses/r...
    Learn everything you need to know about Visual Studio Code - www.udemy.com/learn-visual-st...
    Build a Quiz App - www.udemy.com/build-a-quiz-ap...

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

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

    Promises are still a struggle for me. This has helped a ton. Thanks, James!

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

      So glad to hear that. Yes they are very tricky

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

      Just keep repeating using them, after a while you'll find them so easy to grasp.

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

      @@operationskunkworks5914 That's a very interesting point: the difference between creating and consuming a promise. Of all the tutorials I've seen on the subject, nobody has talked about that.

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

      @@sazaraki not just interesting, but very fundamental. many tutorials talk about the the syntax difference between callback, promise, and async/await, but neglect the more important question about which part of your code is intended to be async (going to background in parallel) and which part is intended to block

    • @marcom6370
      @marcom6370 2 ปีที่แล้ว

      @@sazaraki I found this video about the difference between consuming and writing a promise th-cam.com/video/RvYYCGs45L4/w-d-xo.html

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

    My teacher taught us Asynchronous JavaScript at the end of a class in 15 minutes and I got 0% of it. Thank you for this video

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

    I am not a native English speaker but ur accent is most suitable for me! Thank you for ur content

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

      Glad to hear that!

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

      Hes got that standard American dialect. Not too Boston not too Texas

    • @rajanchawla1285
      @rajanchawla1285 ปีที่แล้ว

      @@JamesQQuick y

    • @rajanchawla1285
      @rajanchawla1285 ปีที่แล้ว

      55ttttttmtattu tattu tattu mm mm mmm mm mmm mm mmm mm mmm mm mmm mm@@JamesQQuickm mmmmmmm mm ttttttt mmmtmmit?mtmtttm

    • @rajanchawla1285
      @rajanchawla1285 ปีที่แล้ว

      @@JamesQQuick mntmmmmmmmm

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

    I'm so glad to hear that asynch js is not only for me difficult to learn, because it's just not sinking in, yet. I'm grateful to learn from your videos, you can explain complex things simple.

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

      its not SYNCING in yet* lmao i'll see myself out- I promise...

    • @tigana
      @tigana ปีที่แล้ว

      @@ramyattalla7168 Lol

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

      you really have to get lost in it a few times before something asynchronously clicks in your head

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

    I understood these concepts better in your 10 min video than in many others 20+ min videos. Thank you.

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

    Thaaaaaaaaank you! This is such a beautifully simple explanation of the whole thing, starting from callbacks to async! Please keep on doing great job.

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

    Hey! I watched a lot of videos, read a lot of articles, but only YOU explained these topics in a clear way! thank you!

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

      Yesssss! Glad to hear it :)

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

    Best one on Async/Await I've seen so far. Excellent!

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

    If you're using the fetch api I recommand checking the value of "response.ok" because code 404 (or whatever code error the pokemon api sends back) is not an error for the fetch api because the server successfully sent back a response.

    • @paulokehie4792
      @paulokehie4792 2 ปีที่แล้ว

      hello sonia. do you have the link to the fetch api?

    • @YamilGonzales
      @YamilGonzales 2 ปีที่แล้ว

      good suggestion, thank you. I just read about it, it makes sense

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

      If you have this issue and it's a node or react project, try axios

    • @alang.2054
      @alang.2054 ปีที่แล้ว

      @@paulokehie4792 You can just literally google it

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

    This is one of the best programming tutorials I've seen for quite some time. Awesome 🤓

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

      Srbija do tokija

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

    One of the best explanations I have come across. Thanks a lot!

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

    Best tutorial on async I have come across. I am 'new' to JS and will jump straight into async/await.

  • @luxs3
    @luxs3 11 หลายเดือนก่อน +4

    What I love about your video is that you don't just explain the code based on the syntax, but you give conrete examples in which it can actually be used.
    This also results in a very natural example for chaining promises (getting json from a response), which makes this super easy to grasp.
    Thank you very much for making this!
    Maybe you could take a look at using async await for concurrent callbacks as well?

    • @Flayer.14
      @Flayer.14 10 หลายเดือนก่อน

      I agree, the chaining promises example was top notch, loved it

  • @elaizaespanola9652
    @elaizaespanola9652 2 ปีที่แล้ว

    You explain this so quickly and so easily. Thank you for your videos. Subscribed already!

  • @andredejesus7427
    @andredejesus7427 2 ปีที่แล้ว

    Watched this as a refresher and it went better than I expected! Thank you for this

  • @mattmjlg5053
    @mattmjlg5053 2 ปีที่แล้ว

    I have to subscribe your content is invaluable. This is like the 5th video I’ve watched from you this week

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

    One of the best clear cut explanation.👍❤️

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

    This helped my all doubts. thanks a ton.

  • @DmitriGoncharov
    @DmitriGoncharov 3 ปีที่แล้ว

    You, sir, are a gentleman and a scholar! Thanks for posting!

  • @NivBarchechet
    @NivBarchechet ปีที่แล้ว

    the best explanation i found. thanks alot, had been struggling with this for a while..

  • @kkbox1125
    @kkbox1125 3 ปีที่แล้ว

    Very concise and informative! Love it

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

    thats how you explain programming.. with examples ... great :)

  • @debhasish
    @debhasish ปีที่แล้ว

    Thank you for the video, This is much much better than the 2h video on youtube about Callbacks, Promises, and Async/Await.

  • @JohnDoe-kw3qu
    @JohnDoe-kw3qu 2 ปีที่แล้ว

    very straight forward, thank you!

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

    Thank you, this video really helped! You did a great job at explaining everything 👍

  • @joecolas
    @joecolas 3 ปีที่แล้ว

    thank you James for letting me understand better the JS Callbacks and Promises

  • @karennason6593
    @karennason6593 ปีที่แล้ว

    This was so helpful! Thanks James, you demystified this topic for me.

  • @phoenix888media9
    @phoenix888media9 10 หลายเดือนก่อน

    You are the best teacher so far me! very easy to understand and very good examples and explanation.

  • @Noone-bb5qh
    @Noone-bb5qh 2 หลายเดือนก่อน

    Thank you my man. This is going to help me a lot for my interview prep.

  • @hamzahmd_
    @hamzahmd_ 3 ปีที่แล้ว

    What a comprehensive explanation of asyn javascript. Great!

  • @miroslavmijatov547
    @miroslavmijatov547 2 ปีที่แล้ว

    Great explanation! Thanks!

  • @guymross
    @guymross 3 ปีที่แล้ว

    Brilliant and concise thanks!

  • @divababy2974
    @divababy2974 2 ปีที่แล้ว

    Thank you so much for this video! Finally somebody put them all together!

  • @RobbyNeale
    @RobbyNeale 3 ปีที่แล้ว

    Fantastic video. Well prepared. Succinct. Everything I could have asked for.

  • @FromRootsToRadicals
    @FromRootsToRadicals ปีที่แล้ว

    Senior dev here and browsing around. Good clean clear vids.

  • @alibaba888
    @alibaba888 2 ปีที่แล้ว

    I watched a couple of videos but only this one worked for me. Thank you for the amazing explanation.

  • @artabramov2254
    @artabramov2254 2 ปีที่แล้ว

    the best explanation of asynchronous abstractions ever. Thank you!

  • @alexkaufmann2923
    @alexkaufmann2923 ปีที่แล้ว

    This video was phenomenal

  • @Remiisola
    @Remiisola 6 หลายเดือนก่อน

    Gold mine for me.
    Thanks for making it easy to understand, thanks to all other videos that prepared my understanding to some level too .

  • @Diegps
    @Diegps 3 ปีที่แล้ว

    This video finally helped me to understand how async works. Thank you so much!

  • @hrzh6721
    @hrzh6721 3 ปีที่แล้ว

    Very straightforward. Thanks A LOT ~~~~

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

    Great explanation! Thank you!

  • @AmaroAmaral
    @AmaroAmaral ปีที่แล้ว

    You are the BEST! Thank you!

  • @enterflux
    @enterflux ปีที่แล้ว

    This was super helpful. All these asynchronous functions are so confusing and this was a great quick guide.

  • @oleksandrploskovytskyy1520
    @oleksandrploskovytskyy1520 3 ปีที่แล้ว

    Big big thanks to you James! Awesome channel!

  • @rogermarksese3048
    @rogermarksese3048 3 ปีที่แล้ว

    Thank you!!!! I now understand the concept of what you've discussed.

  • @fad9981
    @fad9981 ปีที่แล้ว

    Best video on JavaScript I’ve ever watched ❤

  • @snoopysatangore
    @snoopysatangore 2 ปีที่แล้ว

    Great video, clear to the cut explanation!

  • @michaelreynoso2289
    @michaelreynoso2289 2 ปีที่แล้ว

    Great explanation, thanks man!

  • @CodyCleggMusic
    @CodyCleggMusic 3 ปีที่แล้ว

    Personal favorite video on the subject. Thank you!

  • @bencooper2753
    @bencooper2753 3 ปีที่แล้ว

    Wow, very well put together. Very helpful.

  • @theresasecore9372
    @theresasecore9372 2 ปีที่แล้ว

    Thank you so much for this explanation - I had a lightbulb moment while watching this video and I finally get it - Thank you!

  • @nemtomism
    @nemtomism 2 ปีที่แล้ว

    Good job! Thank you from Hungary!

  • @iiWolff
    @iiWolff 2 ปีที่แล้ว

    What a vídeo! Well done mate.

  • @jingli9232
    @jingli9232 2 ปีที่แล้ว

    extremely clear, thx so much

  • @pouyajavadi1751
    @pouyajavadi1751 3 ปีที่แล้ว

    Well described..i will have this as a reference to implement and practice on my projects. Thank you

  • @MrStefanica
    @MrStefanica 3 ปีที่แล้ว

    Bravo! Super explanation ! Thanks !

  • @ANDREPEIXOTO1
    @ANDREPEIXOTO1 3 ปีที่แล้ว

    Subscribed! Great content 👏👏

  • @hsiang-yehhwang2625
    @hsiang-yehhwang2625 2 ปีที่แล้ว

    Nice!! Thanks for sharing!!

  • @rsdbolso8003
    @rsdbolso8003 ปีที่แล้ว

    Async / Await all the way!
    Amazing video, very well explained!

  • @lukebennellick4315
    @lukebennellick4315 2 ปีที่แล้ว

    Great video - nice and clear, thank you.

  • @ikryper
    @ikryper 3 ปีที่แล้ว

    Great job explaining

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

    Hi James, this is one of the best concise video I have ever seen on some of the most difficult concepts in JS. Thank you very much for this.

    • @JamesQQuick
      @JamesQQuick  2 ปีที่แล้ว

      So glad you enjoyed it!

  • @derickmoncado
    @derickmoncado 3 ปีที่แล้ว

    Great content man. Loved this!

  • @shonendumm
    @shonendumm ปีที่แล้ว

    This was a very clear explanation, I finally understand it now after 5 years. Thank you!
    I wish to learn require and import next. :)

  • @user-kj7bn8ls3b
    @user-kj7bn8ls3b 2 ปีที่แล้ว

    Hi! James, thank you for these video. I appreciate you describe with good examples there.

  • @kuldeeps1ngh
    @kuldeeps1ngh 3 ปีที่แล้ว

    Excellent explaination of async await. Thanks

  • @digitalmastery3736
    @digitalmastery3736 2 ปีที่แล้ว

    This is amazing. Thankyou

  • @ammarhassan_
    @ammarhassan_ 3 ปีที่แล้ว

    Recently came across your channel via Twitter, Love ur videos.,It took me 2 yrs to understand callbacks (give and back) but it was worth it, I can now know it is working and how to create HOF.

  • @baay81
    @baay81 ปีที่แล้ว

    Great summary. Thanks a lot!! The last version is more readable for me too. I will adopt that.

  • @Dadaadad268
    @Dadaadad268 ปีที่แล้ว

    Thanks, that helped a lot!

  • @suhanikashyap839
    @suhanikashyap839 7 หลายเดือนก่อน

    Very Helpful!

  • @jennacorre8084
    @jennacorre8084 11 หลายเดือนก่อน

    Thanks for this!!

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

    This seems like a good syntax and concept introduction, what it lacks is actual explanation on how exactly these calls are executed, in what queue, order over time etc.

  • @cmanna285
    @cmanna285 2 ปีที่แล้ว

    LOVE THIS!

  • @boyanich
    @boyanich 3 ปีที่แล้ว

    Nice and easy to understand, thx man!

  • @user-mo8de5hl9g
    @user-mo8de5hl9g 2 ปีที่แล้ว

    Information is given in super comprehensible way. Really like tutorials like this🖥

  • @anishjoshi1999
    @anishjoshi1999 2 ปีที่แล้ว

    Thank you so much. You have no idea what this means to me.

  • @marikabasagoitia6828
    @marikabasagoitia6828 ปีที่แล้ว

    Awesome, thanks!

  • @davidtillery6250
    @davidtillery6250 2 ปีที่แล้ว

    Thank you! wery helpful:)

  • @nonesomeone5357
    @nonesomeone5357 2 ปีที่แล้ว

    I really like your videos James, so keep doing what you're doing. Thanks for your time and effort.⌨🖥💻

  • @toufexisk
    @toufexisk 2 ปีที่แล้ว

    Excellent explanation!
    Thank you! : ' )

  • @varswe
    @varswe 11 หลายเดือนก่อน

    examples were practical, easy to understand tutorial

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

    Hi,
    I am new to JS but out of all the syntaxes I have learned from traditional to es6 and above, await async seems like easiest one to manage. In terms of updating the code and maintenance, async await is the way to go. It is more concise which makes it less prone to human error … You are a great teacher, the only thing I wasn’t familiar with in your video was the fs read only stuff… I get the gist of it, but I would like to learn more details. If you already made a vid on it I will find it your library. I am one of your newest subscribers. Thanks for the content❤

  • @multihrab
    @multihrab 2 ปีที่แล้ว

    Great video, really helped me undertand asynchronous js.

  • @felixmoure11
    @felixmoure11 2 ปีที่แล้ว

    thanks, super clear

  • @EliasDeveloper
    @EliasDeveloper 3 ปีที่แล้ว

    It was awesome! Thanks

  • @khankaka7632
    @khankaka7632 2 ปีที่แล้ว

    best explanation thank you so much

  • @Sammorris207
    @Sammorris207 3 ปีที่แล้ว

    Thanks for the content it's really helpful.

  • @abderahmaneaoufi
    @abderahmaneaoufi 3 ปีที่แล้ว

    Thanks this is was simple and comprehensive thank you so much i'm going to love async and await just like you ..

  • @eduardolucas391
    @eduardolucas391 2 ปีที่แล้ว

    Awesome video!

  • @Yunyopern
    @Yunyopern 2 ปีที่แล้ว

    Great video dude.

  • @ArpanNeupaneProductions
    @ArpanNeupaneProductions 2 ปีที่แล้ว

    Very useful!

  • @ayoubmouatamid9869
    @ayoubmouatamid9869 2 ปีที่แล้ว

    That was amazing and simple

  • @To-mos
    @To-mos 2 ปีที่แล้ว

    Man the web has changed so much since I started in '02. It's all so so much better now!

  • @Hyuts
    @Hyuts 2 ปีที่แล้ว

    Second most confusing to Neural Nets to me. Thank you so much for the succinct explanation!

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

    1M likes for this video. I love the way you implement the code using different approaches. Thanks @James.

  • @yangwilliam3137
    @yangwilliam3137 10 หลายเดือนก่อน

    Spent 3 hours trying to figure these topics out. This explained it perfectly. Thanks James!

    • @JamesQQuick
      @JamesQQuick  10 หลายเดือนก่อน +1

      YAYYY! So glad :)

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

    in just few minutes I got inspired! , the way you confidently explain things is super. like you🤩my sub is added already. keep helping us sir

  • @ethaneisenhard
    @ethaneisenhard 3 ปีที่แล้ว

    Great video and examples James! Thanks for sharing 🥳

    • @JamesQQuick
      @JamesQQuick  3 ปีที่แล้ว

      Thanks for watching. Glad you enjoyed it :)