ADD: negate.md

This commit is contained in:
Michael Gutman
2017-12-24 01:28:52 -05:00
parent 7dee250830
commit a038e12505

12
snippets/negate.md Normal file
View File

@ -0,0 +1,12 @@
### negate
Negates a predicate function.
Take a predicate and apply `not` to it with its arguments.
```js
const negate = predicate => (...args) => !predicate(...args)
// filter([1, 2, 3, 4, 5, 6], negate(isEven));
// => [1, 3, 5]
```