Ad
  • Default User Avatar

    isNaN is entirely unrelated to whether a string represents a number
    it answers the question of whether a value is the particular value NaN

    you could of course hope that failed conversion to Number results in NaN, but, yikes.

    (also, redundant ternary, it turns true to true and false to false, you already have that same without boolean applying that operation)

  • Default User Avatar
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution