Created
December 21, 2016 13:51
-
-
Save spoeken/4dac6c60f331fa980f79dd7d807e674e to your computer and use it in GitHub Desktop.
Is this a phone number?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isNumeric = num => { | |
return !isNaN(num) | |
} | |
const isPhone = function(number){ | |
if(number.length >= 8 && isNumeric(number) ){ | |
return true | |
} | |
return false | |
} | |
export default isPhone |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment