Introduction
In this lab, we will explore a JavaScript code snippet designed to check if a string input represents a 'yes' or 'no' answer. The yesNo
function uses regular expressions to test if the input matches 'y' or 'yes' for a true response, 'n' or 'no' for a false response, or a default value if none is provided. You will have the opportunity to test this function with different inputs and defaults, and gain a better understanding of how regular expressions can be used in JavaScript.