Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tungv/neg
Functional negation
https://github.com/tungv/neg
Last synced: about 2 months ago
JSON representation
Functional negation
- Host: GitHub
- URL: https://github.com/tungv/neg
- Owner: tungv
- Created: 2017-12-06T08:04:01.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-06T08:10:56.000Z (about 7 years ago)
- Last Synced: 2024-10-29T03:33:38.067Z (about 2 months ago)
- Language: JavaScript
- Homepage: https://npm.im/neg
- Size: 23.4 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Functional Negation
`neg` exports only one function that takes a `test` function and return a
negated one that will return true if `test` returns falsy and `false` otherwise# Example
```js
const neg = require('neg');const isOdd = x => x % 2;
const isEven = neg(isOdd);
console.log(isEven(2)); // returns true
console.log(isEven(1)); // returns false
```