|
|
|
|
|
by mynegation
2294 days ago
|
|
“!!” is a way to convert any “falsy” value to a Boolean false. E.g. if you have a flag “enableFoo” that can take the values of undefined, null, numerical zero, NaN, empty string, and actual Boolean false, all these values will be converted to false with “not not”. All other values, including - ironically - “false” as a string, will be converted to Boolean true. |
|