Task:
ATM machines allow 4 or 6 digit PIN codes and PIN codes cannot contain anything but exactly 4 digits or exactly 6 digits.
If the function is passed a valid PIN string,
function validatePIN (pin) {
return typeof pin === 'string' && // verify that the pin is a string
Number.isInteger(+pin) && // make sure that the string is an integer when converted into a number
[4, 6].includes(pin.toString().length) // only accepts 4 and 6 character pins
}