Symbol.search JavaScript

The JavaScript Symbol.search property finds out the index within a string that matches with the regular expression. Syntax: [Symbol.search](string) Parameters: string: It represents the string that matches against the regular expression. Returns: Index of the specified string with a match. Example 1: <!DOCTYPE html> <html> <body> <script> class obj { constructor(a) { this.a = a; … Read more