>= 0 vs !== -1

Benchmark created on


Preparation HTML

<script>
 var a = 'foo';
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
>= 0
a.indexOf('foo') >= 0;
a.indexOf('bar') >= 0;
ready
!== -1
a.indexOf('foo') !== -1;
a.indexOf('bar') !== -1;
ready
!= -1
a.indexOf('foo') != -1;
a.indexOf('bar') != -1;
ready

Revisions

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