我在网上找不到同样的问题。 IE 11 给出错误“对象不支持属性或方法 fill
”。
var arr = new Array(5);
arr.fill(false);
有没有方便的方法来填充数组而不是使用 for
循环?谢谢。
原文由 6324 发布,翻译遵循 CC BY-SA 4.0 许可协议
我在网上找不到同样的问题。 IE 11 给出错误“对象不支持属性或方法 fill
”。
var arr = new Array(5);
arr.fill(false);
有没有方便的方法来填充数组而不是使用 for
循环?谢谢。
原文由 6324 发布,翻译遵循 CC BY-SA 4.0 许可协议
我面临同样的问题,不添加任何东西。
只需打开 polyfills.ts 文件并取消注释以下行:
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';
每件事都会开始工作。
原文由 Ali Adravi 发布,翻译遵循 CC BY-SA 4.0 许可协议
13 回答13k 阅读
7 回答2.1k 阅读
3 回答1.3k 阅读✓ 已解决
6 回答1.2k 阅读✓ 已解决
2 回答1.4k 阅读✓ 已解决
3 回答1.3k 阅读✓ 已解决
6 回答1.1k 阅读
安装 简单 的 polyfill 并继续使用
.fill(…)
。