bind vs scope (v4)

Revision 4 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(a) {
      this.a = a;
    },
  };
  
  var fBind = A.f.bind(A);
  var fScope = A.f.scope(A);
  var fCall = function() { A.f.call(A, ...arguments) }

Test runner

Ready to run.

Testing in
TestOps/sec
bind
fBind(1);
ready
scope
fScope(1);
ready
call
fCall(1);
ready

Revisions

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