AFAIK, this is considered as a bad practice to use typeof to check the number, as NaN is also has type number (e.g. typeof NaN === "number"; // -> true). Moreover, typeof when used against number will return number, as a result, in lower case (i.e. not Number but number).
AFAIK, this is considered as a bad practice to use
typeof
to check the number, asNaN
is also has typenumber
(e.g.typeof NaN === "number"; // -> true
). Moreover,typeof
when used against number will returnnumber
, as a result, in lower case (i.e. notNumber
butnumber
).Yeah the casing of
number
was just a typo. Adjusted it to check for NaN.