try...catch 語法
try {
throw "myException"; // 拋出例外
} catch (e) {
// 用來處理任何例外的語句
console.log(e); // 當我有捕捉到時會印出 myException
}finally {
console.log("不管怎樣我都會執行");
}Last updated
try {
throw "myException"; // 拋出例外
} catch (e) {
// 用來處理任何例外的語句
console.log(e); // 當我有捕捉到時會印出 myException
}finally {
console.log("不管怎樣我都會執行");
}Last updated