negation vs length equals zero

Benchmark created by Ralph Holzmann on


Preparation HTML

<script>
  var arr = [];
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Negation
if (!arr.length) {}
ready
Length Equals Zero
if (arr.length == 0) {}
ready
Length Equals Zero (Strict)
if (arr.length === 0) {}
ready

Revisions

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

  • Revision 1: published by Ralph Holzmann on