hasOwnProperty in a closure

Benchmark created by fearphage on


Preparation HTML

<script>
  var
  catpants = 0,
      HOP = function(obj, prop) {
    return Object.prototype.hasOwnProperty.call(obj, prop);
      },
      HOP_cached = (function(hop) {
    return function(obj, prop) {
     return hop.call(obj, prop);
    };
   })(Object.prototype.hasOwnProperty),
      foo = {
    bar: 1
      };
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
HOP
HOP(foo, 'bar');
ready
HOP_cached
HOP_cached(foo, 'bar');
ready

Revisions

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

  • Revision 1: published by fearphage on