It seems like you cant call an argument in your regex expression. Is there such a way? I want it to return true if the key search is in the string.
function sequenceSearch(str, key) {
console.log(/key/g.test(str));
}
console.log(sequenceSearch('arcata', 'cat')); //true