You may use this:
That's the equivalent of
by the way, the
includes() method can also take an optional "start" parameter, that indicates which position to start the search from (its default value is 0).
Thus, the full syntax of the string.includes() method becomes:
P.S. As others mentioned below,
.includes() is not majorly supported in older browsers (IE and Opera). So you may use
indexOf() instead, which is not an exact match of
contains() but it does the job really well. In fact, it can be way better than
.includes() in terms of performance.