Async/Await - JavaScript Tutorial

preview_player
Показать описание
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.

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

--

Рекомендации по теме
Комментарии
Автор

I've gone thorough 20-30 videos on async await in the last few days as I am trying to learn JavaScript and Node.js - and hands down this is the best that I've seen for a beginner to learn the concept and build upon it.

VarunVermaUSC
Автор

the reason i like Traversy Media is because you actually start with him like you write all the functions together you create files together, these ones with pre-existing code is not as fun, but its a cool video anyways, thanks

christianonyango
Автор

This really helped me get my head around the differences between the different async JS approaches. Thanks!

seanraz
Автор

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!

christianma
Автор

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

paulocabelloacha
Автор

Hey CodeWorkr . Amazing video. a new subscriber to your channel . Also your accent is not bad . In fact it is very good to understand and the examples you provide is very simple and clean . please do keep it up . Expecting more videos from you on tricky concepts. 👏👏👏

madhulathachowdary
Автор

Very finely explained - Helped me clearly understand the fundamentals

PriyankRupareliya
Автор

Async is amazing, thanks for the wonderful breakdown!

HostDotPromo
Автор

inner async with try/catch, Okay, new view for me, usually, I just use one try/catch block for using the Promise fn().

havefun
Автор

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

la
Автор

Great Job!! Can you explain if Data is an array why is it declared as an Const Variable (referencing timer 26:02 seconds)?

akashgvalani
Автор

Big Like before watch
Great channel ==> awesome videos
Keep going guys!

abdulhadilababidi
Автор

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

muhammadnadeembashir
Автор

How can we start all powerplant in parallel?

nikhiljoshi
Автор

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

ZippoGee
Автор

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

MrRicharddaniel
Автор

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

szyszak
Автор

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

zaydenrosario
Автор

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.

yanpelov
Автор

import asyncio
oops wrong video, cya!

DivineZeal