第一步: 安装 babel-polyfill 。 babel-polyfill可以模拟ES6使用的环境,可以使用ES6的所有新方法
cnpm install --save babel-polyfill
第二步: 在 Webpack/Browserify/Node中使用
在webpack.config.[js](http://lib.csdn.net/base/javascript)文件中,使用
module.exports = { entry: { main: ["babel-polyfill", "./src/main.js"] }};
替换
module.exports = { entry: { main: './src/main.js' }}
1:使用ES6的浏览器兼容性问题。 segmentfault.com/a/119000000…