Javascript Array filter(callbackfn, thisArg)

Description

Javascript Array filter(callbackfn, thisArg)



Array.prototype.filter = function (callbackfn, thisArg) {
  var xs = [];/*  ww  w  . j av  a 2 s . c o  m*/
  for (var i=0; i<this.length; i++)
    if (Kernel.Reflect.apply(callbackfn, thisArg, [this[i], i, this]))
      xs[xs.length] = this[i];
  return xs;
}



PreviousNext

Related