Test name | Executions per second |
---|---|
text.includes() | 7434792.0 Ops/sec |
regex.test() | 5249996.5 Ops/sec |
string.match() | 4480768.5 Ops/sec |
string.indexOf() | 7437299.0 Ops/sec |
var url='https://www.google.com/matchthis/other/args'
url.includes('matchthis')
/matchthis/.test(url)
url.match(/matchthis/)
url.indexOf('matchthis') >= 0