当用户输入如下内容时,我无法捕获referenceError:
var myName = Maria;
代替
var myName = "Maria";
谢谢你的时间!
try { var myName = Maria; } catch (e) { if (e instanceof ReferenceError) { // Handle error as necessary } }