kb/data/developer.mozilla.org/en-US/docs/Glossary/Falsy-0.md

12 KiB

title chunk source category tags date_saved instance
Falsy - Glossary | MDN 1/3 https://developer.mozilla.org/en-US/docs/Glossary/Falsy reference web, html, css, javascript, documentation 2026-05-05T05:31:10.056372+00:00 kb-cron

MDN HTML HTML: Markup language

HTML reference

HTML guides

Markup languages

CSS CSS: Styling language

CSS reference

CSS guides

Layout cookbook

JavaScriptJS JavaScript: Scripting language

JS reference

JS guides

Web APIs Web APIs: Programming interfaces

Web API reference

Web API guides

All All web technology

Technologies

Topics

Learn Learn web development

Frontend developer course

Learn HTML

Learn CSS

Learn JavaScript

Tools Discover our tools

About Get to know MDN better

Blog

  1. Glossary
  2. Falsy

Falsy

A falsy (sometimes written falsey) value is a value that is considered false when encountered in a Boolean context. JavaScript uses type conversion to coerce any value to a Boolean in contexts that require it, such as conditionals and loops. The following table provides a complete list of JavaScript falsy values:

Value Type Description
null Null The keyword null — the absence of any value.
undefined Undefined undefined — the primitive value.
false Boolean The keyword false.
NaN Number NaN — not a number.
0 Number The Number zero, also including 0.0, 0x0, etc.
-0 Number The Number negative zero, also including -0.0, -0x0, etc.
0n BigInt The BigInt zero, also including 0x0n, etc. Note that there is no BigInt negative zero — the negation of 0n is 0n.
"" String Empty string value, also including '' and ````.
document.all Object The only falsy object in JavaScript is the built-in document.all.
The values null and undefined are also nullish.

In this article

Examples

Examples of falsy values in JavaScript (which are coerced to false in Boolean contexts, and thus bypass the if block):

The logical AND operator, &&

If the first object is falsy, it returns that object:

See also