https://github.com/writetome51/javascript-not
An alternative to the sneaky ! negation operator for Javascript
https://github.com/writetome51/javascript-not
alternative javascript negation operator substitute
Last synced: about 1 month ago
JSON representation
An alternative to the sneaky ! negation operator for Javascript
- Host: GitHub
- URL: https://github.com/writetome51/javascript-not
- Owner: writetome51
- License: other
- Created: 2019-02-23T21:31:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-04-20T19:52:49.000Z (about 5 years ago)
- Last Synced: 2025-02-02T07:33:05.579Z (over 1 year ago)
- Topics: alternative, javascript, negation, operator, substitute
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# not(booleanExpression): boolean
It's an alternative to writing `!(booleanExpression)`.
`not` is just a little more noticeable than the sneaky `!` negation operator.
## Examples
```js
not(false); // --> true
not(true); // --> false
not(1 === 2); // --> true
if ( not( isEmpty( [1,2,3,4] ) ) ) {
console.log('The array contains items');
}
// console: 'The array contains items'
```
## Installation
`npm i @writetome51/not`
## Loading
```js
import { not } from '@writetome51/not';
```