Files
30-seconds-of-code/snippets/nor.md
2022-06-09 13:13:42 +03:00

24 lines
478 B
Markdown

---
title: Logical nor
tags: math,logic
expertise: beginner
unlisted: true
cover: blog_images/succulent-8.jpg
firstSeen: 2021-03-29T21:20:41+03:00
lastUpdated: 2021-04-02T16:47:15+03:00
---
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
```