javascriptnode.jsnumbersisnan

Why is isNaN('-10') false?


Just curious as to why isNaN('-10') is false? I was thinking isNaN('-10') should be true, but isNaN(-10) should be false?

Does Javascript try to convert strings to numbers before applying isNaN?


Solution

  • isNaN implicitly converts to Number type. Link