function throwError(){ throw new Error('ERROR');
}
try{
setTimeout(throwError, 0);
} catch(e){
alert(e);//這里的異常無法捕獲}這樣可以function throwError(){ try{ throw new Error('ERROR');
}
} catch(e){
alert(e);//這里的異常無法捕獲}
setTimeout(throwError, 0);為什么第一個例子的異常不能捕獲?
捕獲回調函數中的異常?
阿晨1998
2018-10-16 15:16:19