I'm getting stumped with this task. I've tried several alternatives, including the provided solutions in the other two discussions and I still get errors 2. and 4.
Right now this is the code I have been testing:
export const checkSpam = (text, spamKeywords) => {
let s = text.toLowerCase();
for (let i = 0; i < spamKeywords.length; i++) {
let spam = spamKeywords[i];
let result = s.match(spam);
if (result === null) {
return false;
} else {
return true;
}
}
}