Test name | Executions per second |
---|---|
text.includes() | 6977162.0 Ops/sec |
regex.test() | 4539774.0 Ops/sec |
string.match() | 3518100.2 Ops/sec |
string.indexOf() | 7411861.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