1/**2* @param {string} s3* @param {string} p4* @return {boolean}5*/67var isMatch = function (s, p) {8const pattern = new RegExp("^" + p + "$"); // ^ means start of string, $ means end of the string, these are to prevent certain pattern that match a part of the string to be returned as true.9return pattern.test(s);10};