Loading search index…
No recent searches
No results for "Query here"
The Symbol.search static data property represents the well-known symbol @@search. The String.prototype.search() method looks up this symbol on its first argument for the method that returns the index within a string that matches the current object.
Symbol.search
@@search
String.prototype.search()
For more information, see RegExp.prototype[@@search]() and String.prototype.search().
RegExp.prototype[@@search]()
The well-known symbol @@search.
class caseInsensitiveSearch { constructor(value) { this.value = value.toLowerCase(); } [Symbol.search](string) { return string.toLowerCase().indexOf(this.value); } } console.log("foobar".search(new caseInsensitiveSearch("BaR"))); // 3
search
core-js
Symbol.match
Symbol.matchAll
Symbol.replace
Symbol.split
© 2005–2023 MDN contributors.Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search