Does it match?

Report a typo

Create a pattern to match the code below.

'bat' // match
'cat' // match
'at'  // don't match
'att' // don't match

You don't need to call the function; just return the result.

Sample Input 1:

bat

Sample Output 1:

true
Write a program in JavaScript
function doesItMatch(string) {

}
___

Create a free account to access the full topic