🎵 I’m a Java girl in a Java world…
Sadly, JavaScript breaks the cadence :(
I’m a JavaScript girl, I only know about null and undefined. But my guess would be N/A, just by method of elimination?
∞: They said the N-word, but if we ask “did they say the N-word yesterday?” and go back a day if the answer is no, we will be iterating forever.
Overflow: They said the N-word sometime before Jan 1st 1970.
NaN: Days since the last time they said the N-word: “yes”
🎵 I’m a Java girl in a Java world…
Sadly, JavaScript breaks the cadence :(
There are actually two interpretations of N/A:
N/A (not available): There is lost media so it can’t be evaluated.N/A (not applicable): The show is in sign language so evaluating that is outside the scope of this string-matching program.Meanwhile, undefined seems to mean the value has not yet been evaluated. Maybe null is really the best.
Whaaat Javascript is famously known for being extremely weird with NaN values lol
Yeah but we almost never use them intentionally. In almost any project, NaN only happens if there’s a bug. The others are regularly on purpose.
People use NaN on purpose? 😨😨😨
BlackRoseAmongThorns@slrpnk.net 20 hours ago
All these special values are from the spec for floating point numbers, integers don’t have them, in JS specifically all numbers are floats.
An
Option<int>does a good of showing intent.