HAve you guys used `Number.isNaN()` ? I get an err...
# suitescript
i
HAve you guys used
Number.isNaN()
? I get an error saying
TypeError: Cannot find function isNaN in object function Number() { [native code for Number.Number, arity=1] }
then I thought, well I’ll use
typeof
but came across that in javascript (don’t know if in any other language is the same haha) `typeof NaN == Number`so, any ideas, what Im just trying to do is on a reduce just trying to get the total of, but some cases the value of the variable is a a dash
'-'
b
Number.isNaN is too new.
use isNaN instead. keep in mind that they aren't the same.
i
Oh I see, thanks @battk I just did a quick search to check for NaN and came accross the
Number.isNan()
and as it worked on my jsbin haha, good to know!
s
reliably determining if something is number-like is oddly difficult in JS