Can someone help me with the correct syntax for checking if a numeric value (or a variable that is meant to be numeric) is Nan, so I can set it to a numeric value?
I have
if (isNaN(sessionStorage.newDate)){
sessionStorage.newDate=1984;
}
But it returns the error 'isNan is not defined'
I'm using the html5 sessionStorage as a variable, but I don't think it's dependent on that as I can't get to to work with any variable.
(code above edited to be correct)