Test name | Executions per second |
---|---|
text.includes() | 33369206.0 Ops/sec |
regex.test() | 21100954.0 Ops/sec |
string.match() | 18288242.0 Ops/sec |
string.indexOf() | 32881176.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