Skip to content

Business Quote by Eric Freeman

“What does it mean to assign the value null to a variable? How about “We intend to assign an object to this variable at some point, but we haven’t yet.” Now, if you’re scratching your head and saying “Hmm, why didn’t they just use undefined for that?” then you’re in good company. The answer comes…” quote by Eric Freeman
Download Open image
““What does it mean to assign the value null to a variable? How about “We intend to assign an object to this variable at some point, but we haven’t yet.” Now, if you’re scratching your head and saying “Hmm, why didn’t they just use undefined for that?” then you’re in good company. The answer comes from the very beginnings of JavaScript. The idea was to have one value for variables that haven’t been initialized to anything yet, and another that means the lack of an object. It isn’t pretty, and it’s a little redundant, but it is what it is at this point. Just””

Eric Freeman

About This Quote

Source Book: Head First JavaScript, 2005

Explains why JavaScript uses both null and undefined to differentiate uninitialized variables from absent objects.

In simple terms: Null vs undefined: different meanings.

Key Takeaway

Use appropriate value for intent.

Themes

programming clarity language design

Mood

technical educational

Type

explanatory informative

When to use this quote

  • coding
  • debugging
  • API design
  • education

Key Concepts

type theory runtime behavior

Questions to Reflect On

  • When should you use null vs undefined?
  • How does this affect code reliability?
A Different Perspective

Having two similar values can cause confusion.

2.7 out of 5 (8 ratings)

More by Eric Freeman

Explore all 90 Eric Freeman quotes

More Business quotes

Browse all 38,995 Business quotes