The two methods, indexOf() and search(), are equal. They accept the same arguments (parameters), and they return the same value. However, the search() method can take much more powerful search values.The search() method searches a string for a specified value (a string in a string) and returns the position of the match. In this example, the quotation marks used to define the variable locally are not counted, (as they are when defined globally):