implemented array.prototype.filter()