Created
September 17, 2018 20:40
-
-
Save rmrotek/a6d2eeb57a907a8c680b30495ccc9e01 to your computer and use it in GitHub Desktop.
PIN validation
This file contains hidden or 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
| function validatePIN(pin) { | |
| if (pin.match(/^\d{4}$|^\d{6}$/) && (pin.length == 4 || pin.length == 6)){ | |
| return true; | |
| } | |
| else { | |
| return false; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment