!isNaN(value - 0)

Tal Liron tal.liron at threecrickets.com
Wed Mar 25 00:40:26 UTC 2015


In most JavaScript engines, this would return true if value is fully 
numerical:

!isNaN(value - 0)

But in Nashorn, it returns true if even if value is a string that begins 
with a number. It seems that arithmetic with strings is working 
non-standardly in Nashorn.


More information about the nashorn-dev mailing list