diff --git a/snippets/reject.md b/snippets/reject.md index a5e691767..90010a58e 100644 --- a/snippets/reject.md +++ b/snippets/reject.md @@ -3,9 +3,9 @@ title: reject tags: array,beginner --- -Filters an array's values based on a predicate function, returning only values for which the predicate function returns `true`. +Filters an array's values based on a predicate function, returning only values for which the predicate function returns `false`. -Use `Array.prototype.filter()` in combination with the predicate function, `pred`, to return only the values for which `pred()` returns `true`. +Use `Array.prototype.filter()` in combination with the predicate function, `pred`, to return only the values for which `pred()` returns `false`. ```js const reject = (pred, array) => array.filter((...args) => !pred(...args));