bind vs closure (v25)

Revision 25 of this benchmark created on


Setup

var o = { a : 2 };
  
  var bound = function () {
      return this.a;
  }.bind(o);
  
  var closure = (function () {
      var self = o;
      
      return function () {
          return self.a;
      };
  })();

Test runner

Ready to run.

Testing in
TestOps/sec
Closed
closure();
ready
Bound
bound();
ready

Revisions

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