Javascript Array filter(checker)

Description

Javascript Array filter(checker)


Array.prototype.filter = function(checker){
  const newArray = []//w  w w.j  a  v  a2s .c o m
  this.forEach(member =>{
    if (checker(member)) {
      newArray.push(member)
    }
  })
  return newArray
}



PreviousNext

Related