Does anyone know what NaN means?


Not A Number. It can occur when you try to divide by zero or take a root of a negative number but in this case it may have occured because the browser is trying to display an uninitialised variable.
tldr: it's a bug.

Not A Number. It can occur when you try to divide by zero or take a root of a negative number but in this case it may have occured because the browser is trying to display an uninitialised variable.
tldr: it's a bug.
The root of a negative number is some multiple of i, which is a number, just an imaginary one.

You're correct but NaN is stored in a floating point register, which is a representation of what we call a real number in mathematics. Floating point arithmetic doesn't support imaginary or complex numbers so when a complex number would arise from an operation we store a special bit pattern to denote it, called NaN. In hindsight it would've been better denoted as NaR for Not a Real, but it has been standardised as NaN for about 40 years.