How to check if string contains another substring

The easiest way to check if string contains another substring is by using indexOf() Javascript method. The indexOf() method returns the position of the first occurrence of the specified value in a string. If...