1. <script>
    2. try{
    3. con.log("hello world")
    4. }catch(err){
    5. console.log("err");
    6. throw new Error("错误");
    7. }
    8. console.log(3);
    9. </script>
    10. //输出
    11. err
    12. 01.html:15 Uncaught Error: 错误
    13. at 01.html:15
    1. <script>
    2. try{
    3. console.log(1);
    4. con.log("hello world")
    5. }catch(err){
    6. console.log(err);
    7. }finally{
    8. console.log(2);
    9. }
    10. </script>
    11. //输出
    12. 1
    13. ReferenceError: con is not defined
    14. at 02.html:13
    15. 2