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
白衣染霜花
随时随地看视频慕课网APP
相关分类