Uitsonderings in Sinkroniese Styl in JavaScript
Die sinkroniese sintaksis van beloftes ondersteun
die hantering van uitsonderings deur gewone try-catch:
async function func() {
try {
let res = await getSmth(2);
console.log(res);
} catch (err) {
console.log(err);
}
}
func();