From aa5a00b516cb460c218ea15e17b3dcc9f1574907 Mon Sep 17 00:00:00 2001 From: Dharmesh Singh Date: Mon, 29 Mar 2021 23:50:41 +0530 Subject: [PATCH] added nor snippet --- snippets/nor.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 snippets/nor.md diff --git a/snippets/nor.md b/snippets/nor.md new file mode 100644 index 000000000..6e7b2f1d1 --- /dev/null +++ b/snippets/nor.md @@ -0,0 +1,20 @@ +--- +title: nor +tags: math,logic,beginner +unlisted: true +--- + +Returns the logical nor of the given two values. + +- Use the logical not (`⬇`) operator to return the inverse of the logical-or the given two values. + +```js +const nor = (a,b) => !(a||b); +``` + +```js +nor(true,true); // false +nor(true,false); // false +nor(false,true); // false +nor(false,false); // true +```