contains() vs indexOf

Benchmark created on


Setup

var string = 'foobarfoobar';

Test runner

Ready to run.

Testing in
TestOps/sec
indexOf
string.indexOf('rf');
ready
contains
string.contains('rf');
ready

Revisions

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