Deprecated: Function create_function() is deprecated in /var/www/vhosts/ on line 70
Async/Await – JavaScript Tutorial |
  • Saturday , 24 October 2020

Async/Await – JavaScript Tutorial

Code Canyon

This is an in-depth look at the Async/Await feature in JavaScript.


First, we’re going to go through brief history of asynchronous programming in JavaScript and see how it transitioned from callbacks to promises to generators and to finally Async/Await.

Then we’re going to focus purely on Async/Await and we’ll go through a bunch of examples.

We’ll start off by learning how we can do sequential flow using Async/Await and we’ll also see how we need to be careful about error handling.

Next, we’ll move onto parallel execution. We’ll see how we can use Promise.all() function to be able to execute multiple promises in parallel. Again, we’ll see why we need to be careful about our error handling.

Last but not least, we’ll take a look at how we can do iterations with Async/Await. We’ll start off with for loop, then move onto forEach, for of loop is going to be next and finally we’ll wrap that section with while loop.

At the end, we’ll do a quick recap of the things we just went through.

⭐️Contents ⭐️
⌨️ 0:00 – Introduction
⌨️ 1:28 – Callbacks Example
⌨️ 6:44 – Promises Example
⌨️ 9:40 – Async/Await Example
⌨️ 13:18 – Coding Examples Begin
⌨️ 14:09 – Sequential Example (Naive)
⌨️ 19:27 – Sequential Example (Issue)
⌨️ 21:18 – Sequential Example (Solution)
⌨️ 23:48 – Parallel Example (Naive)
⌨️ 27:21 – Parallel Example (Issue)
⌨️ 28:58 – Parallel Example (Solution)
⌨️ 31:55 – For Loop Example
⌨️ 36:49 – ForEach Example
⌨️ 40:06 – For-Of Example
⌨️ 42:06 – While Loop Example
⌨️ 44:03 – Recap

Tutorial from CodeWorkr. Check out the CodeWorkr channel for more great tutorials:

Learn to code for free and get a developer job:

Read hundreds of articles on programming:

And subscribe for new videos on technology every day:

Original source

3d Ocean

Related Posts


  1. CodeWorkr
    January 5, 2020 at 08:48

    Hey everyone, original author here! 👋
    I'm super humbled that freeCodeCamp has reached out to me and asked me for this video.
    Hope you'll enjoy this video! If you like it and would like to see more of similar content – you can, of course, check out my channel.
    Regarding audio quality and my pronunciation of English – this is one of my older videos and I'd like to think that both things have improved over time. Improving English (as a non-native speaker) in particular is more of a life-long journey (as is programming!).
    Would be happy to answer any questions you might have!

  2. Simone Icardi
    January 5, 2020 at 08:48

    nice one!!

  3. Zayden Rosario
    January 5, 2020 at 08:48

    38:57 Try adding async before powerPlant, so it will be like this powerPlants.forEach(async powerPlant => {

  4. Lincoln Morais
    January 5, 2020 at 08:48

    you're such a legend. thanks for this video!

  5. drewski west
    January 5, 2020 at 08:48

    what are the package.json files?

  6. szyszak
    January 5, 2020 at 08:48

    Just a little note, you didn't declare variables in for-of loops, which is a bad practice.

  7. roittmi
    January 5, 2020 at 08:48

    in sequential-naïve-proceses.js, are process01 and process02 functions? How re they declared as functions without the function keyword?

  8. Di Qian
    January 5, 2020 at 08:48

    Really awesome tutorial! Thx

  9. Muhammad Nadeem Bashir
    January 5, 2020 at 08:48

    Please make a tutorial on recursion in javascript with many examples and explanation please thanks ..

  10. Larry Gutman
    January 5, 2020 at 08:48

    Thanks, CodeWorkr. I learned a lot. What editor are you using?

  11. Christian Ma
    January 5, 2020 at 08:48

    Excellent video! Very well prepared and demonstrated. The little hint about async/await not working with functions using a callback themselves was awesome. That was my main point, why I still struggled. Thanks a lot!

  12. sonu gupta
    January 5, 2020 at 08:48


  13. SamT
    January 5, 2020 at 08:48

    Awesome work really.

  14. Richard Messi
    January 5, 2020 at 08:48

    Hi please do a course on redux. Love the long crash courses. They are great

  15. JC S
    January 5, 2020 at 08:48

    the narrator was unlistenable, sorry

  16. Yan P
    January 5, 2020 at 08:48

    the only useful thing in the video is the promise all function, that actually shows performance benefit. what's the point of using async/await sequencially? take note that it can even degrade performace running sequencially because of the extra overhead.

  17. The Angriest Puppy
    January 5, 2020 at 08:48

    Generators make my head hurt

  18. sai sreenivas
    January 5, 2020 at 08:48

    Thank you

  19. TottiBln
    January 5, 2020 at 08:48

    I love You! 😉

  20. Kornel Kornecki
    January 5, 2020 at 08:48

    Thanks mate for great explanation. But please please please improve your English pronunciation – it's painful to listen.

  21. Host Promo
    January 5, 2020 at 08:48

    Async is amazing, thanks for the wonderful breakdown!

  22. Divine Zeal
    January 5, 2020 at 08:48

    import asyncio
    oops wrong video, cya!

  23. Abdulhadi Lababidi
    January 5, 2020 at 08:48

    Big Like before watch

    Great channel ==> awesome videos

    Keep going guys!

  24. Jashan Bansal
    January 5, 2020 at 08:48
    Explore this guys, it will help you!

  25. 77Sazaca
    January 5, 2020 at 08:48


  26. Paulo Cabello Acha
    January 5, 2020 at 08:48

    Just now that I'm learning Javascript. Thanks a lot guys!

  27. haris bashir
    January 5, 2020 at 08:48


Leave A Comment

You must be logged in to post a comment.