if

Benchmark created on


Setup

str = "this is my string"

Test runner

Ready to run.

Testing in
TestOps/sec
normal
if (str.indexOf('bla') === -1 && str.indexOf('bli') === -1) {
   myvar = 'la'
}
 
ready
opt
if (str.indexOf('bla') + str.indexOf('bli') === -2) {
  myvar = 'la'
}
ready

Revisions

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