(Built-in) way in JavaScript to check if a string is a valid number

前端 未结 30 3351
-上瘾入骨i
-上瘾入骨i 2020-11-22 01:54

I\'m hoping there\'s something in the same conceptual space as the old VB6 IsNumeric() function?

30条回答
  •  旧巷少年郎
    2020-11-22 02:18

    I used this function as a form validation tool, and I didn't want users to be able to write exponential function, so I came up with this function:

    
    

提交回复
热议问题