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 +```