Travis build: 249
This commit is contained in:
@ -1279,7 +1279,7 @@ Negates a predicate function.
|
|||||||
Take a predicate function and apply `not` to it with its arguments.
|
Take a predicate function and apply `not` to it with its arguments.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const negate = func => (...args) => !fun(...args);
|
const negate = func => (...args) => !func(...args);
|
||||||
// filter([1, 2, 3, 4, 5, 6], negate(isEven)) -> [1, 3, 5]
|
// filter([1, 2, 3, 4, 5, 6], negate(isEven)) -> [1, 3, 5]
|
||||||
// negate(isOdd)(1) -> false
|
// negate(isOdd)(1) -> false
|
||||||
```
|
```
|
||||||
|
|||||||
@ -856,7 +856,7 @@ async function sleepyWork() {
|
|||||||
<div class="card fluid"><div class="section double-padded"><h3 id="negate">negate</h3></div><div class="section double-padded">
|
<div class="card fluid"><div class="section double-padded"><h3 id="negate">negate</h3></div><div class="section double-padded">
|
||||||
<p>Negates a predicate function.</p>
|
<p>Negates a predicate function.</p>
|
||||||
<p>Take a predicate function and apply <code>not</code> to it with its arguments.</p>
|
<p>Take a predicate function and apply <code>not</code> to it with its arguments.</p>
|
||||||
<pre><code class="language-js">const negate = func => (...args) => !fun(...args);
|
<pre><code class="language-js">const negate = func => (...args) => !func(...args);
|
||||||
// filter([1, 2, 3, 4, 5, 6], negate(isEven)) -> [1, 3, 5]
|
// filter([1, 2, 3, 4, 5, 6], negate(isEven)) -> [1, 3, 5]
|
||||||
// negate(isOdd)(1) -> false
|
// negate(isOdd)(1) -> false
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|||||||
Reference in New Issue
Block a user