SyntaxFix
Write A Post
Hire A Developer
Questions
This can be done in 2 ways:
if (str.match(/abc|def/)) { ... } if (/abc|def/.test(str)) { .... }