undefined and NaN are not constants. They are global…
““undefined and NaN are not constants. They are global variables, and you can change their values. That should not be possible, and yet it is. Don’t do it.””
About This Quote
This interpretation was drafted with AI assistance. It is one reading of the quote, not the author's own explanation.
NaN and undefined are mutable global variables, contrary to expectations of constant behavior.
In simple terms: These values can be altered, which is unsafe.
Never reassign NaN or undefined.
Themes
Mood
Type
When to use this quote
- Code reviews
- static analysis
- team coding standards
Key Concepts
Questions to Reflect On
- Why were NaN and undefined designed as mutable?
- What safeguards can prevent accidental changes?
Changing them can break libraries and cause bugs.