Top 5 Async Mistakes for JavaScript Beginners (Don’t make these!)
HTML-код
- Опубликовано: 11 июл 2024
- Don’t make these beginner mistakes working with Async code in JavaScript!
*QUESTIONS ABOUT MY SETUP*
Check out my Uses page for my VS Code setup, what recording equipment I use, etc. www.jamesqquick.com/uses
*STAY IN TOUCH 👋*
Check out the Podcast - compressed.fm/
Courses - jamesqquick.com/courses
Newsletter 🗞 - www.jamesqquick.com/newsletter
Follow me on Twitter 🐦 - / jamesqquick
*DISCORD*
Join the Learn Build Teach Discord Server 💬 - / discord
*TIMESTAMPS*
00:00 Intro
00:30 Not Understanding Promises
03:20 Not Using Correct Async Await Syntax
06:15 Not Handling All Errors
08:40 Not Writing Performance Code By Using Promise.all
11:00 Awaiting When You Don't Need To
James you asked awhile ago what kind of content we the viewers are looking for? This is exactly the kind of “top tips for [enter JS topic]” that we find the most helpful.
Also, these videos are likely to go viral which would help out your viewer and subscriber count
Thank you so much for this response! My wife and i have been talking about this for a while, and that's basically what we came up with. Kinda getting back to the basic. Again, thank you for the positive feedback. It really means a lot!
Nice tips, James! Thank you
My pleasure!
Very, very useful!!
Glad to hear that!
Thx so much!!!
Happy to help
Thanks James for other good video 👍
No problem 👍
The npm package called "express-async-errors" handles async errors for us, so it's not a must to do it manually
James - thanks for the video. With the promises array and Promise.all() what's the memory limit? I run into this often. Also, with Promise.all() and the email example, it will stop execution when there is a failed promise. This can get tedious to know which emails were successful. I like using Promise.allSettled to know what was successful or failed.
Good video.
Thank you!
Great.... today i was facing performance issues with loop & async await... tommarow i will try...and hopefully it will work 😅
Good luck!
Chapter names would be super helpful in a video like this.
It actually does have the timestamp metadata. I'm not sure why it's not showing up...
Ah I had a typo. Fixed now!
3:45 Won't that return an error since the "await" keyword can only be used inside an asynchronous function?
I actually didn't exactly think about that, but it seemed to work on my end. Actually kind curious why/how that works there
good question
@@JamesQQuick Top level of modules now work with await. This wasn't always the case, but it's been in place in Node and browsers for a while now. You can really screw yourself pretty badly with loading the module tree if you await something slow or circular at the top level, so be careful with it.
Very good video. Really nice examples, always good to have a refresh on this topic, but sorry to say that not as good as your Remix swag 🤣🤣🤣 so jealous.
hahaha one day maybe you'll get a Remix hoodie!
@@JamesQQuick will work twice more for that 🤣
" console.log(await loadPokemon(1)) " - Isn't this syntax incorrect? I mean "await" in the console.log.
Which extension he is using which allows to console in the vs code ? 🙄
It's the Quokka extension. It's super nice!
@@JamesQQuick that feature isn't fully free, is it?
Why do you have to do stupid faces in the thumbnails? You're above that.
Well research shows those typically help with CTR, so that's why. Sorry if they're cringy :)