From b71ef81a4a86ce7dc98341bfc94ec8bc26497db1 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Wed, 13 May 2020 11:28:26 +0300 Subject: [PATCH] Add logical not --- snippets/not.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 snippets/not.md diff --git a/snippets/not.md b/snippets/not.md new file mode 100644 index 000000000..b96478490 --- /dev/null +++ b/snippets/not.md @@ -0,0 +1,17 @@ +--- +title: not +tags: math,logic,beginner +--- + +Returns the logical inverse of the given value. + +Use the logical not (`!`) operator to return the inverse of the given value. + +```js +const not = a => !a; +``` + +```js +not(true); // false +not(false); // true +```