indexOf and the tilde operator (v2)

Revision 2 of this benchmark created on


Description

Bitwise simplicity goes head-to-head with more proven implementations.

Test runner

Ready to run.

Testing in
TestOps/sec
more than -1
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.