👨🏫 Co-Founder of This is Learning, Organizer of AarhusJS
✍️ Writer, Speaker, FOSS Maintainer 📗 Author
🏆 Microsoft MVP 🌟 GitHub Star
🌊 Nx Champion 🦸 Angular Hero of Education
I mean it's something to be aware of and it's often overlooked and not mentioned at all in articles discussing and guiding on async-await.
The difference between this and promises is that catch callbacks can be put specifically in any place in a promise chain. Of course, we can also do this with try-catch around a single statement, but that gets ugly pretty fast, especially if we want to keep the same variable scope between related try-catch blocks.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I mean it's something to be aware of and it's often overlooked and not mentioned at all in articles discussing and guiding on
async-await
.The difference between this and promises is that catch callbacks can be put specifically in any place in a promise chain. Of course, we can also do this with
try-catch
around a single statement, but that gets ugly pretty fast, especially if we want to keep the same variable scope between relatedtry-catch
blocks.