美文网首页
不支持foreach

不支持foreach

作者: TRYao | 来源:发表于2018-07-27 16:15 被阅读0次
    if (typeof Array.prototype.forEach != 'function') {
        Array.prototype.forEach = function(callback){
          for (var i = 0; i < this.length; i++){
            callback.apply(this, [this[i], i, this]);
          }
        };
    }
    

    相关文章

      网友评论

          本文标题:不支持foreach

          本文链接:https://www.haomeiwen.com/subject/vkjgmftx.html