3.17 錯誤補捉(Errors)
範例 1:try...catch...
my_func("Welcome");
alert("hello");try{
my_func("Welcome");
alert("hello");
}catch(error){
alert("執行 error 的程式");
console.log(error);
}
alert("繼續執行");範例 2:throw
範例 3:finally
Last updated