Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 js 类在 Chrome 中运行良好,但是当我在 IE 中测试时,脚本按预期失败,给出了一个丑陋的语法错误。 有什么方法可以测试客户端浏览器是否可以在 javascript 中处理 ES6 类?
从技术上讲,你可以
try { eval('"use strict"; class foo {}'); } catch (e) { console.log(e); }
实际上,我认为至少这些天更喜欢它而不是编译是合理的。