Learn Regular Expressions by Building a Spam Filter - Step 12

This code runs and i don’t understand why

const isSpam = (msg) => denyList.some((regex) => regex.test(msg)) || helpRegex.test(msg);

1 Like

Why is the || there?

I just tried it and it worked so i’m confused as well

Hmm, try not using the || and everything after


yeah that’s the correct answer Thank you

1 Like

This is such a great explanation. It helped me solve and understand this one. I literally created a new account to like and post this. Thank you lasjorg!

1 Like

Thank you, this is very helpful!

It would be nicer if the instruction could just tell us to amend the existing code


Thank you! This explanation also helped me as well.

This is one of the issues I’m facing with this JavaScript course. I find that certain steps are way to vague or too jargon heavy without a easier explanation.

I don’t need to to be shown baby steps, but I also need a little more more to go off of sometimes or maybe the hint system could provide a stronger explanation. JavaScript is still very new to me and I often feel lost with some of these steps.


The new curriculum is still being worked on. It will slowly improve over time, I’m sure.

I do agree this step could be clarified a bit better. Anyone can open an issue for it if they would like to.

1 Like

Guys this just an appreciation for solving the problem, and I realised it started from January and finally solved on May well done guys that is the spirit of a developer.