ie 11问题

在ie11 浏览器中,为什么用了

      while(true){ 
          num = Math.floor(Math.random() * n);
         if(i>10){
           break;
         }
      }
      

这个会提示。object error。对象不支持includes属性和方法

      
      
      
      怎么改造成其他的形式
阅读 2.7k
4 个回答

缺少上下文,应该是兼容问题,添加下polyfill

和这段代码没关系吧
按楼主描述的话, 在某处用了includes方法
加下兼容性代码

if (!Array.prototype.includes) {
    Array.prototype.includes = function(){
        return Array.prototype.indexOf.apply(this, arguments) > -1
    }
}

java都是一股脑的json里面,js实在不行

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题