How Async Javascript works (Callback Hell, Promises, Async Await, Call Stack and more)
ฝัง
- เผยแพร่เมื่อ 9 มิ.ย. 2024
- Check out my web development courses here 🔥
developedbyed.com/
🛴 Follow me on:
Twitch: / developedbyed
Twitter: / developedbyed
Instagram: / developedbyed
Github: github.com/developedbyed/
#programming - วิทยาศาสตร์และเทคโนโลยี
I think it would be really fun if we did a series on focusing on one specific aspect of Javascipt and make a fun series out of it!
Example: A full episode on event handlers (how to make a custom one, how it works, etc etc) 👀
Let me know if you like the idea 🔥
Anyone playing Street Fighter 6?
Great ideas Ed! thanks for teaching. Youre hitting 1 million this year bro! I love the idea of intermediate/advanced concepts because often times people explain things shallowly in their examples (for time) so its difficult to understand concepts when you want to use them in your own way.
Other concepts that are kinda important: prop drilling (now with client & server comps this is critical) Closures [functional programming], prototypes, OOP, event loop, Linked list, Hash, BFS, DFS.
Cheers
That would be nice :)
That sounds fire
amazing idea
Yes, full send that idea!
This is the first TH-cam video that made me happy, thank you my friend, I've wanted to understand this topic for so long and finally I found someone who could describe the workings of JavaScript so thoroughly.
Thanks again my gorgeous teacher on the internet. 🙏
Love it 😂😂😂
😂😂😂
You’re so good at explaining thoroughly. Thank you very much!
THE best video I personally have seen about these concepts. I have started learning how to code early last year and JS is still very difficult for me at time. This video has helped me understand things in 30 mins that I have not understood in the last 1.5 years. Huge compliment and please keep doing these basic concept JS videos, they are gold!
I’ve been coding for close to 8 years now and have been been watching videos for quite many years and I’d just like let you know that your recent videos have been gold. I think the basics and creating clones of apps are long overplayed and many people will benefit from videos like this. Awesome teacher, would love to see you teach people more technical stuff like you have been the last month 👍🏻🔥
That's definitely a great video to put everything in context. I personally would like to see such a format with different JS topics. I don't think that it's really entertaining but for people loving to understand deeply what's going on, it's definitely a much better approach.
SetTimeout is a webAPI. This gets handled by the browser instead of JavaScript. So instead of going staight into the queue, it goes into the WebAPI stack until the time is up. Then gets pushed into the queue, behind the other logs which is why it shows up last
Hi Ed, I really appreciate your videos as i decided to use a JS framework to rewrite a project that was pooly optimised in a different technology. It really helps to watch someone when reading docs becomes tiring. Thanks
As always, the way Ed teaching me with his funny way that makes me easily understand again about this context. I remember first time I learn Javascript is from Ed JS playlist, so thank you so much Ed! 😄
Great explanation of the call stack vs the web API's and event loop!
Great timing! I‘m working as a react developer for 1 1/2 years now and sometimes I‘m just not aware of some of this concept. This was super interesting to get a little refresher and a deeper understanding!
I love this. Always good to watch such concepts because it's a refresher.
Really waited for that one from you, thanks !
I have been following you for many years now and the excitement never stops when I see your video every time. Btw the video clarity is fantastic. What’s the camera you’re using? ❤
i absolutely enjoy this kind of humor when I'm learnign to program, so thank you for that! Makes learnign much less mind numbing
This was fantastic! Exactly what I was looking for.
Great video, and really well explained on the different concepts!
Nawet nie zdajesz sobie sprawy jak bardzo długo szukałem tego typu video, spadłeś mi po prostu z nieba❤
to jest Polak ?????????????????
wonderful and precise tutorial ,wins a subscription
Been working on Js since years but trust me, haven't found callbacks & promises being explained like this, even a junior dev could understand this without any hassle.
Super nice to see actual programming in this channel and not just trendy frameworks conventions.
Love the new format, I think I finally get how async works
Great demo and explanation. Cheers !
One of the best session watched..:)
this is my new favorite channel
Thank you for the great explanation! ❤️
I just had an interview that went over these concepts too. Wish I would have watched this video beforehand. I’m definitely turning on the notifications now😅
Correction: 9:36 CallStack works on LIFO and Callback queue works on FIFO.
⚠Warning Your this video is now obsolete:
th-cam.com/video/_8gHHBlbziw/w-d-xo.html&t
Much needed bruddah......thanks a lot ed
WOW🤩 Very nice Explanation
Thank you! Good and useful content 😎
nice explanation -- thanks bro
Love it thank you so much man!
Nice work , I believe this episode is great
I am telling you,This guy is a GEM❤
Thank you for this
i gona revised function and your teaching way is sooo awesome
async function is more than easy by Promise
Hi, great video! New to promises and await, @26:45 why do we need to await when creating the const data ? isnt the variable response already set/saved? or is it just a placeholder for the function? If so, the await command is already in the response variable. Just trying to understand :)
"Time's up m*therf*cker!" Had me on the floor rolling LMAO
7:55 im going to say this everytime I run a setTimeout from now on 🤷♂️😂
02:13 - Two types of context
06:54 - first console log, third and then second is called because of call stack
08:22 - Call Stack
14:54 - Call Back Hell
19:50 - Custom Promise Example
22:43 - Real word promise example
26:35 - Async and await example
Great video!
7:56 caught me off guard hahahahahaha
This was a masterpiece by Ed, a comment from an experienced developer
thanks pal❤❤
THANK YOU!!!
9:28 Shouldn't it get pushed one by one, only when previous removeTodo() finishes and call stack is empty, and not everything at once?
Nice video, but how can I get a value from the response returned as part of the function? Seems like the return value of a async function is always a promise? how can I get even maybe a wrapper function to just give me a string in the end, after waiting for the result?
I feel the remove function which you showed stacking in call stack section is wrong because queue will not push the functions unless the stack is empty
@Ed, could you please create testing React App courses or TH-cam videos using RTL, Vitest for unit and integration and Cypress for E2E testing
Async JS; nicely explained. Thanks, Ed
{2023-06-27}
Do u create also a video about Axios ;) ?
I was unable to hold myself when you said 2000 seconds.
worker threads are changing the single threaded nature of js
Hi Ed, can I get the name of the music in the background please
Amazing
loved it
Hey ed 👋🏼 also if you like live wallpaper, Razer makes amazing high quality software that I think called Cortex? High quality live wallpaper 👍🏻 best I’ve used!
Add those chapters Ed
Microsoft's True Intention Leaked at 7:18 !
After a long, I see you. By the way seeing your video I happened to become a software engineer at the age of 41 and completing 3 years now
Faking luv you eddy Boiii!
Are you using an OLED tv as a monitor?
do the web APIs run in different threads?
What is that VSCode theme? anyone knows?
Thanks! to Gorgeous teacher on internate 💝❤
anyone knows what his vscode theme is? it looks really clean
awesome vid btw, keep it up
Did you figure out what the theme was called? I can't find it.
Damn! Nice and easy!
You re really funny!
When your team leader is Samuel L. Jackson 7:55
Would it look better if you flip/mirror your camera horizontal? so it looks like you are looking at the actual content while showing it to us
I think he meant Last in First out LiFo 9:36
2:30
😊 Awesome
9:30 First in First out doesn't work that way. It pushes on top, but process the first (oldest) one on the bottom.
He meant Last in First out LiFo I guess
Ed I need another video like this but explain it to me like I'm 12 lol
👏👏👏
🎉
Dr. Strange is teaching programming now? That's cool..
❤
thks, take care of your health
I thought callstack is FILO. or FIFO? not sure anymore.
love the sweater❤, no homo
Tik tok, times up MFer. Great lesson!
😂😂😂 tick tock tik took tiMesuP !!!😅
I was very concentrated on what you explain then you came with the ' tick tac , tick tac , tick tac , time is up mothafucka' :)))) MY BELLY HURT BECAUSE OF LAUGHING . Other than that , excellent explanations ! Multumesc frumos ;) !
7:43 --> *ms
putangina you described it the best very noice moite i subbed.
theon gratjoy
nice refreshing video after a long time. i would say you could have started with hoisting first.
Always love your videos but the examples are a bit confusing. I think some people might be lost…
Just an honest feedback! Keep the good work! 👍🏼
Oh that’s alright! Which bit did you find confusing? 😊
@@developedbyed for example, the part on call stack, web APIs and event loop. I guess it is a bit difficult to understand for a beginner with the examples chosen and Excalidraw. (I know it is not easy to explain and understand visually)
Also on the promise, at 18:52, I think you got confused because you called in the user object the attribute “user” instead of “name” and I would have continued in you example instead of fetching jsonplaceholder. For example, you could have created a promise which resolves if user name is “Blanka” but rejects if user name is “Ken” and then illustrates it in the .then.catch chain, and finally use the same example with async await…
No offense, I am just providing my view but I might be too picky ;)
Don't forget about the Swedish and Norwegians 😉
keep eye on health buddy...
is this stuff really considered advanced?
can i get the source code for this video?
timesup mf 🤣🤣
🆒🆒🆒
💕💕✅✅
don't try to change your voice