How to check whether a string contains a substring in JavaScript?
Asked 07 September, 2021
Viewed 1.2K times
  • 55
Votes

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 Answer