How to check whether a string contains a substring in JavaScript?

Viewed 7355144

Usually I would expect a String.contains() method, but there doesn't seem to be one.

What is a reasonable way to check for this?

3 Answers
Related