我可以在 JavaScript 中为用户定义的异常定义自定义类型吗?如果是这样,我该怎么做?
From 网络参考 http://webreference.com/programming/javascript/rg32/index-2.html:
throw {
name: "System Error",
level: "Show Stopper",
message: "Error detected. Please contact the system administrator.",
htmlMessage: "Error detected. Please contact the <a href=\"mailto:[email protected] /cdn-cgi/l/email-protection\">system administrator</a>.",
toString: function(){return this.name + ": " + this.message;}
};
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)