Comparison operations
suggest changeWhen using boolean coercion, the following values are considered “falsy”:
false0""(empty string)nullundefinedNaN(not a number, for example0/0)0n(BigInt zero)document.all(a legacy browser object that is falsy even though it is an object)
Everything else is considered “truthy”, including [] and {}.
Abstract equality, inequality, and type conversion
NaN Property of the Global Object
Short-circuiting in boolean operators
Logic Operators with Non-boolean values boolean coercion
Equality comparison operations
Grouping multiple logic statements
Bit fields to optimize comparison of multi state data
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents