The opposite of array.filter

PHOTO EMBED

Tue Aug 31 2021 20:53:12 GMT+0000 (Coordinated Universal Time)

Saved by @hisam #javascript

The reject function is like .filter but in reverse, so you can. You can use the filter function and reverse the callback with the Logical Operator NOT to reverse the outcome.

Array.prototype.reject = function(fn){return this.filter(x => !fn(x))}
content_copyCOPY