NaN mean "Not A Number"
Everything you save in webstorage is saved as a string. So when you retrieve the data from webstorage you will have to cast it back to a number if it was a number you saved.
set myNumber to int(Webstorage.LocalValue("webstorageNumber"))
it is the "int()" that converts the string to an integer(a number).
Hope it helps.