鍍金池/ 問答/數(shù)據(jù)庫  HTML/ ie 11問題

ie 11問題

在ie11 瀏覽器中,為什么用了

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

這個會提示。object error。對象不支持includes屬性和方法

      
      
      
      怎么改造成其他的形式
回答
編輯回答
朕略傻

clipboard.png

2018年6月24日 00:30
編輯回答
舊顏

java都是一股腦的json里面,js實在不行

2018年1月24日 19:36
編輯回答
櫻花霓

和這段代碼沒關(guān)系吧
按樓主描述的話, 在某處用了includes方法
加下兼容性代碼

if (!Array.prototype.includes) {
    Array.prototype.includes = function(){
        return Array.prototype.indexOf.apply(this, arguments) > -1
    }
}
2017年11月26日 11:07
編輯回答
葬憶

缺少上下文,應(yīng)該是兼容問題,添加下polyfill

2018年7月24日 21:11