function filter(ary, fun) {
  var len = ary.length >>> 0,
  res = [];

  if (typeof fun !== 'function') {
    throw new TypeError();
  }

  let thisp = fun;

  for (let i = 0; i < len; i++) {
    if (i in ary) {
      let val = ary[i]; // in case fun mutates ary

      if (fun.call(thisp, val, i, ary)) {
        res.push(val);
      }
    }
  }
  return res;
}
/**
 * create a filter array function
 * @param  {Array}      Array which you want to make filter on it
 * @param  {Function}   Filter function
 * @return {Array}     Filtered Array
 */
create a filter array function
@param  {Array}      Array which you want to make filter on it
@param  {Function}   Filter function
@return {Array}     Filtered Array
create a filter array function @param { Array } Array which you want to make filter on it @param { Function } Filter function @return { Array } Filtered Array
function filter(ary, fun) {
  var len = ary.length >>> 0,
  res = [];
  if (typeof fun !== 'function') {
    throw new TypeError();
  }
  let thisp = fun;
  for (let i = 0; i < len; i++) {
    if (i in ary) {
      let val = ary[i]; 
      if (fun.call(thisp, val, i, ary)) {
        res.push(val);
      }
    }
  }
  return res;
}
function filter ( ary , fun ) { var len = ary . length >>> 0 , res = [ ] ; if ( typeof fun !== 'function' ) { throw new TypeError ( ) ; } let thisp = fun ; for ( let i = 0 ; i < len ; i ++ ) { if ( i in ary ) { let val = ary [ i ] ; if ( fun . call ( thisp , val , i , ary ) ) { res . push ( val ) ; } } } return res ; }
create a filter array function
 @param  {Array}      Array which you want to make filter on it
 @param  {Function}   Filter function
 @return {Array}     Filtered Array
create a filter array function @param { Array } Array which you want to make filter on it @param { Function } Filter function @return { Array } Filtered Array
// in case fun mutates ary
