Skip to content

Technology Quote by Eric Freeman

“There are five falsey values in JavaScript: undefined is falsey. null is falsey. 0 is falsey. The empty string is falsey. NaN is falsey.” quote by Eric Freeman
Download Open image
““There are five falsey values in JavaScript: undefined is falsey. null is falsey. 0 is falsey. The empty string is falsey. NaN is falsey.””

Eric Freeman

About This Quote

Source Book: Head First JavaScript, 2005

JavaScript treats several values as false in conditionals, including undefined, null, 0, empty string, and NaN.

In simple terms: These five values evaluate to false.

Key Takeaway

Remember these falsey values when writing conditionals.

Themes

programming JavaScript truthiness

Mood

cautious analytical

Type

technical educational

When to use this quote

  • debugging
  • code reviews
  • teaching JavaScript
  • writing tutorials

Key Concepts

type coercion boolean logic

Questions to Reflect On

  • How do falsey values affect your code flow?
  • Can you rely on truthiness for safety checks?
A Different Perspective

Only these five are falsey; other falsy values exist in other languages.

3.9 out of 5 (8 ratings)

More by Eric Freeman

Explore all 90 Eric Freeman quotes

More Technology quotes

Browse all 12,247 Technology quotes