From e16bcaef5028eae86eca1facfb09103b2975b681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=AE=B6=E8=BD=B6?= <117028813@qq.com> Date: Fri, 3 Apr 2020 09:29:33 -0500 Subject: [PATCH] Update reject.md --- snippets/reject.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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));