在ie11 浏览器中,为什么用了
while(true){
num = Math.floor(Math.random() * n);
if(i>10){
break;
}
}
这个会提示。object error。对象不支持includes属性和方法
怎么改造成其他的形式
在ie11 浏览器中,为什么用了
while(true){
num = Math.floor(Math.random() * n);
if(i>10){
break;
}
}
这个会提示。object error。对象不支持includes属性和方法
怎么改造成其他的形式
和这段代码没关系吧
按楼主描述的话, 在某处用了includes方法
加下兼容性代码
if (!Array.prototype.includes) {
Array.prototype.includes = function(){
return Array.prototype.indexOf.apply(this, arguments) > -1
}
}
10 回答11.1k 阅读
6 回答3k 阅读
5 回答4.8k 阅读✓ 已解决
4 回答3.1k 阅读✓ 已解决
2 回答2.7k 阅读✓ 已解决
3 回答5.1k 阅读✓ 已解决
5 回答2k 阅读
缺少上下文,应该是兼容问题,添加下
polyfill
吧