Travis build: 2000
This commit is contained in:
22
README.md
22
README.md
@ -156,6 +156,7 @@ average(1, 2, 3);
|
|||||||
* [`reducedFilter`](#reducedfilter)
|
* [`reducedFilter`](#reducedfilter)
|
||||||
* [`reduceSuccessive`](#reducesuccessive)
|
* [`reduceSuccessive`](#reducesuccessive)
|
||||||
* [`reduceWhich`](#reducewhich)
|
* [`reduceWhich`](#reducewhich)
|
||||||
|
* [`reject`](#reject)
|
||||||
* [`remove`](#remove)
|
* [`remove`](#remove)
|
||||||
* [`sample`](#sample)
|
* [`sample`](#sample)
|
||||||
* [`sampleSize`](#samplesize)
|
* [`sampleSize`](#samplesize)
|
||||||
@ -2182,6 +2183,27 @@ reduceWhich(
|
|||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
|
### reject
|
||||||
|
|
||||||
|
Takes a predicate and array, like `Array.filter()`, but only keeps `x` if `pred(x) === false`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const reject = (pred, array) => array.filter((...args) => !pred(...args));
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Examples</summary>
|
||||||
|
|
||||||
|
```js
|
||||||
|
reject(x => x % 2 === 0, [1, 2, 3, 4, 5]); // [1, 3, 5]
|
||||||
|
reject(word => word.length > 4, ['Apple', 'Pear', 'Kiwi', 'Banana']); // ['Pear', 'Kiwi']
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
### remove
|
### remove
|
||||||
|
|
||||||
Removes elements from an array for which the given function returns `false`.
|
Removes elements from an array for which the given function returns `false`.
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user