indexOf versus test

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
indexOf
const myBagPathRegex = /^(\/(en-us|en-ca|fr-ca))?\/shop\/mybag$/;
myBagPathRegex.indexOf('https://shop.lululemon.com/shop/mybag')
ready
test
const myBagPathRegex = /^(\/(en-us|en-ca|fr-ca))?\/shop\/mybag$/;
myBagPathRegex.test('https://shop.lululemon.com/shop/mybag')
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.