search() method searches a string for a specified value, and returns the position (index value) of the match.
The following example uses string as a value to be searched.
|searchValue||Required||A value to be searched within this string.|
Use string or regexp to search a value within this string.
|0 to array.length||A index of a searchValue within the string.|
|-1||When the searchValue is not found within the string.|
The following example uses Regexp as a value to be searched.
Please do google search for:
Join Our Channel
This channel is primarily useful for Full Stack Web Developer.