indexOf And Tilde

Benchmark created by Wyatt on


Test runner

Ready to run.

Testing in
TestOps/sec
indexOf
if ('shoe horn'.indexOf('shoe') > -1) {
  //found it
} else {
  //didn't
}
ready
tilde
if (~'shoe horn'.indexOf('shoe')) {
  //didn't find it
} else {
  //did
}
ready

Revisions

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