Greater than zero vs not zero

JavaScript performance comparison

Revision 3 of this test case created by Tomas Corral

Preparation code

<script>
  var zero = 0;
  var ten = 10;
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Greater than zero (false)
zero > 0;
pending…
Greater than zero (true)
ten > 0;
pending…
Not zero (false)
zero != 0;
pending…
Not zero (true)
ten != 0;
pending…
Not zero (exact, false)
zero !== 0;
pending…
Not zero (exact, true)
ten !== 0;
pending…
True (false)
zero;
pending…
True (true)
ten;
pending…
!! zero
!!zero;
pending…
!! ten
!!ten;
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment