java-script:falsy-truthy-values
This is an old revision of the document!
Java Script Falsy Values
A falsy value is a value considered false if it's encountered in a boolean context.
These are the falsy values:
- false: The keyword false itself is obviously considered falsy.
- 0, -0, 0n, -0n: The number zero (including its negative counterpart and big int) is considered falsy.
- “”, '' and `` (empty strings): An empty string is considered falsy.
- null: The null keyword is considered falsy.
- undefined: The undefined keyword is also falsy.
- NaN: “Not a Number” is considered falsy.
java-script/falsy-truthy-values.1691603056.txt.gz · Last modified: 2023/08/09 20:44 by odefta