DEV Community

saaiif
saaiif

Posted on

Mobile number validator

Here you will find use of regex type for phone validator and a look of call back function:)

https://dev-to-uploads.s3.amazonaws.com/i/8upw01kraa9vmgwzgq2p.png

Top comments (3)

Collapse
 
e11y0t profile image
Elliot Wong

Hey Saaiif, just a suggestion - would be nice if you paste the code in the content as well :)

Like:

const phoneNumCheck = (num) => {
  const regex = ... // your regex
  return regex.test(num)
}

phoneNumCheck("123456")
Enter fullscreen mode Exit fullscreen mode

Cheers!

Collapse
 
saaiif profile image
saaiif

Hey sure

Collapse
 
saaiif profile image
saaiif

Check this image