index.js
function filter(arr, cb, thisArg) {
  cb = makeIterator(cb, thisArg);
  if (arr == null) {
    return [];
  }
  var len = arr.length;
  var res = [];
  for (var i = 0; i < len; i++) {
    var ele = arr[i];

    if (cb(ele, i, arr)) {
      res.push(ele);
    }
  }
  return res;
}
function filter(arr, cb, thisArg) {
  cb = makeIterator(cb, thisArg);
  if (arr == null) {
    return [];
  }
  var len = arr.length;
  var res = [];
  for (var i = 0; i < len; i++) {
    var ele = arr[i];

    if (cb(ele, i, arr)) {
      res.push(ele);
    }
  }
  return res;
}
function filter ( arr , cb , thisArg ) { cb = makeIterator ( cb , thisArg ) ; if ( arr == null ) { return [ ] ; } var len = arr . length ; var res = [ ] ; for ( var i = 0 ; i < len ; i ++ ) { var ele = arr [ i ] ; if ( cb ( ele , i , arr ) ) { res . push ( ele ) ; } } return res ; }
Like JavaScript's native filter method, but faster.

@param  {Array}  `arr` The array to filter
@param  {Function} `cb` Callback function.
@param  {Array} `thisArg`
@return {Array}
Like JavaScript s native filter method but faster .