Test for 0: Boolean invert vs equals

Benchmark created on


Description

Tests the speed difference when testing for "equals 0" in an IF statement:

  • by boolean invert
  • by equals to zero

Test runner

Ready to run.

Testing in
TestOps/sec
Boolean invert
if (!0)
  void(0)
ready
Equals
if (0 === 0)
  void(0)
ready

Revisions

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