Published
- 1 min read
Regex validate PIN code
The solution for this is noted below
Regex validate PIN code
Solution
// codewars:Regex validate PIN code
function validatePIN(pin) {
//return true or false
return /^(\d{4}|\d{6})$/.test(pin)
}
Try other methods by searching on the site. That is if this doesn’t work