is not in (v3)

Revision 3 of this benchmark created by Joeytje50 on


Description

testing if something is in another thing

Setup

var a, b = 'alskdjlafjsdlasflkjnsaldknmaslfblaskjdhlaskjdx',
        c, d = 'alskdjlafjsdlasflkjnsaldknmaslfblaskjdhlaskjd';

Test runner

Ready to run.

Testing in
TestOps/sec
indexOf !== -1
a = b.indexOf('x') !== -1; //-> true
c = d.indexOf('x') !== -1; //-> false
ready
indexOf != -1
a = b.indexOf('x') != -1; //-> true
c = d.indexOf('x') != -1; //-> false
ready
indexOf > -1
a = b.indexOf('x') > -1; //-> true
c = d.indexOf('x') > -1; //-> false
ready
~indexOf
a = ~b.indexOf('x'); //-> true
c = ~d.indexOf('x'); //-> false
ready

Revisions

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

  • Revision 3: published by Joeytje50 on