javascript学习(4)异常处理 try-catch 和 onerror

一、try-catch

1、样例1

1.1、源代码

1.2、执行后

 

2、样例2

2.1、源代码

2.2、执行后

二、onerror

1、源代码

 

2、执行后

原文地址:https://www.cnblogs.com/lexiaofei/p/7352184.html