Handling Errors with try-catch-finally
How does try-catch work with async/await compared to Promise.catch()?
try {
const result = await Promise.reject(new Error('Failed'));
} catch (error) {
console.error(error);
}
try {
const result = await Promise.reject(new Error('Failed'));
} catch (error) {
console.error(error);
}