Merge pull request #1737 from Dharmesh78/branch_dharmesh78
This commit is contained in:
19
snippets/nor.md
Normal file
19
snippets/nor.md
Normal file
@ -0,0 +1,19 @@
|
||||
---
|
||||
title: nor
|
||||
tags: math,logic,beginner
|
||||
unlisted: true
|
||||
---
|
||||
|
||||
Checks if none of the arguments are `true`.
|
||||
|
||||
- Use the logical not (`!`) operator to return the inverse of the logical or (`||`) of the two given values.
|
||||
|
||||
```js
|
||||
const nor = (a, b) => !(a||b);
|
||||
```
|
||||
|
||||
```js
|
||||
nor(true, true); // false
|
||||
nor(true, false); // false
|
||||
nor(false, false); // true
|
||||
```
|
||||
Reference in New Issue
Block a user