我在IE11中运行的React项目中的迭代器遇到了问题。
以下是重现该问题的最小代码量;
// index.js
...
import React from 'react'
import ReactDOM from 'react-dom'
import 'core-js'
import 'whatwg-fetch'
import 'react-app-polyfill/ie11';
import 'react-app-polyfill/stable';
const a = [1,2,3,4].values().next();
console.log(a);
...在IE11中,我收到一个错误,显示
SCRIPT438: Object doesn't support property or method 'next'我已经导入了整个'core-js‘库,我还需要导入什么才能在IE11中多填充这个功能?
发布于 2021-02-12 10:21:57
放
import 'react-app-polyfill/ie11';
import 'react-app-polyfill/stable';作为index.js https://www.npmjs.com/package/react-app-polyfill中的前两行
https://stackoverflow.com/questions/66165578
复制相似问题