Fixed styling
This commit is contained in:
@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
Negates a predicate function.
|
Negates a predicate function.
|
||||||
|
|
||||||
Take a predicate and apply `not` to it with its arguments.
|
Take a predicate function and apply `not` to it with its arguments.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const negate = predicate => (...args) => !predicate(...args)
|
const negate = func => (...args) => {
|
||||||
|
return !func(...args);
|
||||||
|
}
|
||||||
|
|
||||||
// filter([1, 2, 3, 4, 5, 6], negate(isEven));
|
// filter([1, 2, 3, 4, 5, 6], negate(isEven));
|
||||||
// => [1, 3, 5]
|
// => [1, 3, 5]
|
||||||
|
|||||||
Reference in New Issue
Block a user