gattsbr gattsbr - 3 months ago 5x
Javascript Question

ReferenceError: 'number' is undefined

In my code I'm trying to explicitly assign the javascript value of NaN to a variable.

This is the mistake I make occasionally:

var myVar = number.NaN;


The answer to this is simple. It's not number.NaN but Number.NaN

var myVar = Number.NaN;