Object property existence check speed

JavaScript performance comparison

Test case created by 1natsu172

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  var baseProps = {foo:1, bar:2, baz:3, qux:4, quus:5};

};
</script>

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
hasOwnProperty with XOR
(baseProps.hasOwnProperty('foo') ^ baseProps.hasOwnProperty('bar')) === 0
pending…
hasOwnProperty with logical AND
baseProps.hasOwnProperty('foo') && baseProps.hasOwnProperty('bar')
pending…
converting NOTs with logical AND
!!(baseProps.foo && baseProps.bar)
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.

0 Comments