Skip to content

Instantly share code, notes, and snippets.

@edg-l
Created May 16, 2016 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edg-l/79ac5850e3735636ebff38484a8299b4 to your computer and use it in GitHub Desktop.
Save edg-l/79ac5850e3735636ebff38484a8299b4 to your computer and use it in GitHub Desktop.
Validate a pin
function validatePIN(pin) {
return /^(\d{4}|\d{6})$/.test(pin)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment