if(/categories/.test(url)) { ... }
I'm using the above code to check whether url contains the string "categories". What is the syntax for checking to see if url container the string "categories" OR "character"?
Thanks!
The vertical pipe | denotes "or" in regular expressions
if(/categories|character/.test(url)) { ... }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With