NaN (Not a Number) in JavaScript — in plain words
Oct 27, 2025 · 2 min read · NaN shows up when JavaScript tries to make a number, but it can’t. You’ll see it a lot while parsing strings or doing invalid math. Fun fact: typeof NaN is "number". A quick look with parseInt Here foo looks like a number, but its type is string. Us...
Join discussion
