Async/Await - JavaScript Tutorial

  Рет қаралды 53,881

freeCodeCamp.org

freeCodeCamp.org

Күн бұрын

Пікірлер: 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.
@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
@seanraz
@seanraz 4 жыл бұрын
This really helped me get my head around the differences between the different async JS approaches. Thanks!
@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!
@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. 👏👏👏
@paulocabelloacha4195
@paulocabelloacha4195 5 жыл бұрын
Just now that I'm learning Javascript. Thanks a lot guys!
@PriyankRupareliya
@PriyankRupareliya 4 жыл бұрын
Very finely explained - Helped me clearly understand the fundamentals
@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).
@annabudonna3566
@annabudonna3566 3 жыл бұрын
Great explanation, thanks!
@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)?
@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().
@la6188
@la6188 5 жыл бұрын
you're such a legend. thanks for this video!
@diqian9239
@diqian9239 5 жыл бұрын
Really awesome tutorial! Thx
@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
@muhammadnadeembashir7940
@muhammadnadeembashir7940 5 жыл бұрын
Please make a tutorial on recursion in javascript with many examples and explanation please thanks ..
@MrRicharddaniel
@MrRicharddaniel 5 жыл бұрын
Hi please do a course on redux. Love the long crash courses. They are great
@abdulhadilababidi8052
@abdulhadilababidi8052 5 жыл бұрын
Big Like before watch Great channel ==> awesome videos Keep going guys!
@simoneicardi3967
@simoneicardi3967 4 жыл бұрын
nice one!!
@saisreenivas2227
@saisreenivas2227 5 жыл бұрын
Thank you
@77Sazaca
@77Sazaca 5 жыл бұрын
Nice!
@nikhiljoshi6155
@nikhiljoshi6155 3 жыл бұрын
How can we start all powerplant in parallel?
@zaydenrosario5047
@zaydenrosario5047 5 жыл бұрын
38:57 Try adding async before powerPlant, so it will be like this powerPlants.forEach(async powerPlant => {
@szyszak
@szyszak 5 жыл бұрын
Just a little note, you didn't declare variables in for-of loops, which is a bad practice.
@pupfriend
@pupfriend 5 жыл бұрын
Generators make my head hurt
@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 }
@harisbashir6074
@harisbashir6074 5 жыл бұрын
Heart
@TottiBln
@TottiBln 5 жыл бұрын
I love You! ;)
@sonugupta410
@sonugupta410 5 жыл бұрын
nice...
@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.
Async JavaScript & Callback Functions -- Tutorial for Beginners
24:21
VAMPIRE DESTROYED GIRL???? 😱
00:56
INO
Рет қаралды 7 МЛН
Flipping Robot vs Heavier And Heavier Objects
00:34
Mark Rober
Рет қаралды 59 МЛН
Human vs Jet Engine
00:19
MrBeast
Рет қаралды 46 МЛН
JavaScript Modules Crash Course
48:38
freeCodeCamp.org
Рет қаралды 49 М.
Settling the Biggest Await Async Debate in .NET
14:47
Nick Chapsas
Рет қаралды 145 М.
Async Await vs. Promises - JavaScript Tutorial for beginners
24:30
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 821 М.
JavaScript Visualized - Event Loop, Web APIs, (Micro)task Queue
12:35
Mastering async code with Typescript and Javascript
39:01
Jack Herrington
Рет қаралды 78 М.
JavaScript ES6, ES7, ES8: Learn to Code on the Bleeding Edge (Full Course)
1:05:27
JavaScript Callbacks, Promises, and Async / Await Explained
38:54
LearnWebCode
Рет қаралды 41 М.
dotJS 2017 - Wes Bos - Async + Await
15:52
dotconferences
Рет қаралды 64 М.
VAMPIRE DESTROYED GIRL???? 😱
00:56
INO
Рет қаралды 7 МЛН