Syntax - Tasty Web Development Treats cover image

Async + Await

Syntax - Tasty Web Development Treats

00:00

How to Handle Errors in JavaScript

Try catch has been around in javascript for a long time and now Uh, it actually is in my opinion become much more useful by having it as the main way of error catching inside of a sync weight. Other options that you have here are with what's called a high order function. You just wrap all your code in a try and then and then you have a catch where if anything goes wrong There's a 404 on one if you're uh, get requests or you have a syntax error. Or when you try to call a method Like on on the return data that the method isn't there then then it's going to all fall back to a dot catch. That's sort of how promises

Play episode from 28:55
Transcript

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app