try{ var num = pompt("請輸入5~10");}catch(err){ console.log(err); console.log(err + "這里我隨便加上一段字符串");}上述代碼中,console.log(err);在控制臺是這樣輸出的:ReferenceError: pompt is not defined at index.html:37,有提示行號。但是console.log(err + "這里我隨便加上一段字符串");在控制臺中輸出是這樣的:ReferenceError: pompt is not defined這里我隨便加上一段字符串,加上了一段字符串,就沒有提示錯誤行號。這是什么原因呢?
關于try、catch、throw的問題?
慕妹3146593
2018-11-09 14:18:46