parseInt always returns NaN?

后端 未结 4 614
太阳男子
太阳男子 2020-12-06 12:48

long story short, i was trying to validate a phone field. ive added the isNaN and parseInt for checking the \" \" in the field but tha

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-06 13:13

    parseInt only returns NaN if the first character cannot be converted to a number.

    https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseInt

提交回复
热议问题