if ( !Array.prototype.forEach ) {

Array.prototype.forEach = function forEach( callback, thisArg ) {

var T, k;

if ( this == null ) {
throw new TypeError( "this is null or not defined" );
}
var O = Object(this);
var len = O.length >>> 0;
if ( typeof callback !== "function" ) {
throw new TypeError( callback + " is not a function" );
}
if ( arguments.length > 1 ) {
T = thisArg;
}
k = 0;

while( k < len ) {

var kValue;
if ( k in O ) {

kValue = O[ k ];
callback.call( T, kValue, k, O );
}
k++;
}
};
}

相关文章:

  • 1970-01-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-16
  • 2021-12-25
  • 2022-12-23
  • 2021-05-18
  • 2021-07-27
  • 2022-12-23
相关资源
相似解决方案