yesNo
Returns true if the string is y/yes or false if the string is n/no.
- Use
RegExp.prototype.test()to check if the string evaluates toy/yesorn/no. - Omit the second argument,
defto set the default answer asno.
Returns true if the string is y/yes or false if the string is n/no.
RegExp.prototype.test() to check if the string evaluates to y/yes or n/no.def to set the default answer as no.