Answers for "test if variable is only numbers js"

9

javascript check if variable is number

function isNumber(n) {
  return !isNaN(parseFloat(n)) && !isNaN(n - 0);
}
Posted by: Guest on May-22-2020
0

Checking for only numbers if statement

if (text.matches("[0-9]+"){
   // your operations
}
Posted by: Guest on December-22-2021

Code answers related to "test if variable is only numbers js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language