startsWith vs indexOf

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
startsWith
"foo/bar/baz/qux/foo/bar/baz/qux/foo/bar/baz/qux".indexOf("__") === 0
ready
indexOf
"foo/bar/baz/qux/foo/bar/baz/qux/foo/bar/baz/qux".startsWith("__")
ready

Revisions

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