bind vs scope (v2)

Revision 2 of this benchmark created on


Setup

Function.prototype.scope = function(ctx) {
    var fn = this;
    return function() {
      return fn.apply(ctx, arguments);
    };
  };
  
  var A = {
    a: null,
    f: function() {
      this.a = 1;
    },
  };

Test runner

Ready to run.

Testing in
TestOps/sec
bind
var fBind = A.f.bind(A);
ready
scope
var fScope = A.f.scope(A);
ready

Revisions

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