DEV Community

Discussion on: NaN - It's Not A Number🙄

Collapse
 
thehanna profile image
Brian Hanna

I discovered this week that NaN is truthy. A bunch of state values were showing undefined in a React app. However, it used server side rendering to initialize the state, and they started as NaN, causing a bunch of things to flash from one value to the next when the state updated. That was a fun two hours.

Collapse
 
radnerus profile image
Suren

I would be more careful when dealing with numbers in state of numbers now😁