【发布时间】:2020-06-24 08:21:04
【问题描述】:
我有代码:
let a = {a: 'a', b: 'b'};
let b = {c: 'c', d: 'd'};
let c = {...a, ...b};
在 chrome/firefox/... 中显示:c = {a: 'a', b: 'b', c: 'c', d: 'd'},但在 microsoft edge 中会抛出错误 Expected identifier, string or number。
我尝试使用cdn.polyfill.io 和https://babeljs.io/docs/en/babel-polyfill,但没有成功。
如何在 microsoft edge 中运行我的 webpack 代码?
【问题讨论】:
-
你在使用 babel 吗?如果是,您可以发布您的 babel 配置吗?
-
Kornflexx,我不使用 babel 来编译我的代码,但我发现一些帖子可以包含 babel polifyls 作为脚本,因此我尝试使用它。
标签: javascript object microsoft-edge spread-syntax