User Tools

Site Tools


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:

  1. false: The keyword false itself is obviously considered falsy.
  2. 0, -0, 0n, -0n: The number zero (including its negative counterpart and big int) is considered falsy.
  3. “”, '' and `` (empty strings): An empty string is considered falsy.
  4. null: The null keyword is considered falsy.
  5. undefined: The undefined keyword is also falsy.
  6. NaN: “Not a Number” is considered falsy.
java-script/falsy-truthy-values.1691603056.txt.gz · Last modified: 2023/08/09 20:44 by odefta