-3

From My database I'll get two kinds of numbers

  1. 1234
  2. a1234z1

We'll call second type of number as special type. How to detect those kind of numbers. for ex like

isSpecialNumber("a1234z1") should return true or false.

How can I do that in Javascript ?

j809
  • 1,499
  • 1
  • 12
  • 22
user3786942
  • 163
  • 1
  • 2
  • 7

1 Answers1

2

You could just test if its a number:

isNaN("a1234z1");

unless you need it to be that exact format then a regex would be needed.

DasBeasto
  • 2,082
  • 5
  • 25
  • 65