Тёмный

Async/Await - JavaScript Tutorial 

freeCodeCamp.org
Подписаться 10 млн
Просмотров 54 тыс.
50% 1

Опубликовано:

 

30 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 45   
@VarunVermaUSC
@VarunVermaUSC 4 года назад
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.
@havefun5519
@havefun5519 2 месяца назад
inner async with try/catch, Okay, new view for me, usually, I just use one try/catch block for using the Promise fn().
@christianonyango7460
@christianonyango7460 4 года назад
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
@pupfriend
@pupfriend 5 лет назад
Generators make my head hurt
@paulocabelloacha4195
@paulocabelloacha4195 5 лет назад
Just now that I'm learning Javascript. Thanks a lot guys!
@seanraz
@seanraz 4 года назад
This really helped me get my head around the differences between the different async JS approaches. Thanks!
@abdulhadilababidi8052
@abdulhadilababidi8052 5 лет назад
Big Like before watch Great channel ==> awesome videos Keep going guys!
@harisbashir6074
@harisbashir6074 5 лет назад
Heart
@77Sazaca
@77Sazaca 5 лет назад
Nice!
@HostDotPromo
@HostDotPromo 5 лет назад
Async is amazing, thanks for the wonderful breakdown!
@CodeWorkr
@CodeWorkr 5 лет назад
Thanks for watching! 🙂 Async really is amazing, best thing that has happened to Node.js (well Promises first and foremost, but then Async/Await as it's a wrapper more or less).
@madhulathachowdary7343
@madhulathachowdary7343 4 года назад
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. 👏👏👏
@saisreenivas2227
@saisreenivas2227 5 лет назад
Thank you
@akashgvalani4213
@akashgvalani4213 4 года назад
Great Job!! Can you explain if Data is an array why is it declared as an Const Variable (referencing timer 26:02 seconds)?
@zaydenrosario5047
@zaydenrosario5047 5 лет назад
38:57 Try adding async before powerPlant, so it will be like this powerPlants.forEach(async powerPlant => {
@TottiBln
@TottiBln 5 лет назад
I love You! ;)
@christianma8160
@christianma8160 5 лет назад
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!
@PriyankRupareliya
@PriyankRupareliya 4 года назад
Very finely explained - Helped me clearly understand the fundamentals
@szyszak
@szyszak 5 лет назад
Just a little note, you didn't declare variables in for-of loops, which is a bad practice.
@muhammadnadeembashir7940
@muhammadnadeembashir7940 5 лет назад
Please make a tutorial on recursion in javascript with many examples and explanation please thanks ..
@nikhiljoshi6155
@nikhiljoshi6155 3 года назад
How can we start all powerplant in parallel?
@annabudonna3566
@annabudonna3566 3 года назад
Great explanation, thanks!
@simoneicardi3967
@simoneicardi3967 4 года назад
nice one!!
@sonugupta410
@sonugupta410 5 лет назад
nice...
@diqian9239
@diqian9239 5 лет назад
Really awesome tutorial! Thx
@MrRicharddaniel
@MrRicharddaniel 5 лет назад
Hi please do a course on redux. Love the long crash courses. They are great
@la6188
@la6188 5 лет назад
you're such a legend. thanks for this video!
@ZippoGee
@ZippoGee 5 лет назад
Thanks, CodeWorkr. I learned a lot. What editor are you using?
@SSantiago90
@SSantiago90 5 лет назад
Larry Gutman It's Microsoft Visual Studio Code
@hulk6315
@hulk6315 3 года назад
@@SSantiago90 lololololololololololololololololol
@yanpelov
@yanpelov 5 лет назад
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.
@CodeWorkr
@CodeWorkr 5 лет назад
Hey Yan! There are situations where you need to do 2 "slow" operations in sequence, where the latter operation depends on the data returned by the former operation. In that situation you'd actually use async/await in sequence and won't use Promise.all(). An example: // Get some data from the DB const data = await grabDataFromDB({ id: 'something' }) // Process said data const processedData = await processData(data) You can't really use Promise.all() here as second line depends on the results of first line.
@yanpelov
@yanpelov 5 лет назад
@@CodeWorkr In the examples you provide in your reply and video there is no preference to async/await over sync ops. the whole purpose of async ops is that you can keep running in the background with other stuff or in parallel. if you don't do that, than there is no point using async await in the first place.
@CodeWorkr
@CodeWorkr 5 лет назад
​@@yanpelov Oh, understand what you mean now - yes, we agree on that, await-ing multiple things in sequence is making the entire flow sequential and there aren't advantages (as when using promise.all). Still, you might be using async/await throughout your project and for example a single function might make a use of both promise.all() (where applicable) and then awaiting operations in sequence where absolutely necessary, so you're still saving time/performance when you can (on promise.all() part) and then doing few things sequentially when you can't get away of doing so. // Some time will be saved because we're not sequentially calling all of them const data = await Promise.all([getData01(), getData02(), getData03()]) // (In between) Some time will be lost because of waiting on upper promise // Some time will be saved because we're not sequentially calling all of them const results = await Promise.all([processData(data[0]), processData(data[1]), processData(data[2])]) That'd be a combination of both "patterns" for example. Of course correct me if you think I'm wrong
@yanpelov
@yanpelov 5 лет назад
@@CodeWorkr btw, consider the following real life example to demonstrate the usefulness of asynchrony in life (pseudo code) : async lifeExample() { prepareSoup() ready = await putSoupOnStove() //takes about 30 minutes to cook do { runOnTreadMillFor10Min() //do workout while soup is cookin' } while (!ready) //open pot lid and check if soup is ready eatSoup() //eat the soup now that it's ready shower() //after you worked out for ~30 mins and ate soup. watchNetflix() //enjoy your evening }
@DivineZeal
@DivineZeal 5 лет назад
import asyncio oops wrong video, cya!
@stumpymartin6074
@stumpymartin6074 5 лет назад
Divine Zeal goo.gl/iL7Apr Latin numerals - Wikipedia
@stumpymartin6074
@stumpymartin6074 5 лет назад
📽👽😇tytnuhuuhht GJ van and trailer
@motomono
@motomono 5 лет назад
Thanks mate for great explanation. But please please please improve your English pronunciation - it's painful to listen.
@CodeWorkr
@CodeWorkr 5 лет назад
You're welcome Kornel! My pleasure! I'm trying, this was one of my older videos, hopefully I'm getting better!
@szumeczek
@szumeczek 5 лет назад
No, it's not painful to listen. It's actually pretty good. Here in New York he would be one of the easier persons to understand :)
@ViniciusRocha-bl1lk
@ViniciusRocha-bl1lk 5 лет назад
@@CodeWorkr I'm brazilian and I can understand you perfectly.
@xcoldbloom
@xcoldbloom 4 года назад
nope, cant deal with this accent.
Далее
dotJS 2017 - Wes Bos - Async + Await
15:52
Просмотров 64 тыс.
Settling the Biggest Await Async Debate in .NET
14:47
Просмотров 144 тыс.
JavaScript Promises  -- Tutorial for Beginners
37:05
Просмотров 124 тыс.
Async JavaScript - Callbacks, Promises, Async/Await
25:10
Kubernetes 101 workshop - complete hands-on
3:56:03
Просмотров 1,6 млн