Double Equals Null

Benchmark created by Peter Wagenet on


Preparation HTML

<script>
  var a = null,
      b = undefined,
      ret;
  
  var none = function(val) {
   return val === null || val === undefined;
  }
  
  var obj = {
   none: none
  };
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Double Equals
ret = (a == null && b == null);
ready
Triple Equals
ret = ((a === null || a === undefined) && (b === null || b === undefined));
ready
Triple Equals Method
ret = none(a) && none(b);
ready
Triple Equals Object Method
ret = obj.none(a) && obj.none(b);
ready

Revisions

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

  • Revision 1: published by Peter Wagenet on