Skip to content

not not

serhij.zolotukhin edited this page Dec 7, 2025 · 1 revision

! is the logical negation or "not" operator.

!! is ! twice.

It's a way of casting a "truthy" or "falsy" value to true or false, respectively.

In JavaScript, the values false, null, undefined, 0, -0, NaN, and '' (empty string) are "falsy" values.

All other values are "truthy."(1):7.1.2

#!csv
 value     | !value | !!value
-----------+--------+-------
 false     | true   | false
 true      | false  | true
 null      | true   | false
 undefined | true   | false
 0         | true   | false
 -0        | true   | false
 1         | false  | true
 -5        | false  | true
 NaN       | true   | false
 ''        | true   | false
 'hello'   | false  | true

My side bar

Clone this wiki locally