call vs apply (v23)

Revision 23 of this benchmark created by tim.roststock on


Setup

function Obj() {
          this.that = "that";
    }
    Obj.prototype.target = function(test) {
       this.that = test;
    };
    
    var inst = new Obj();

Test runner

Ready to run.

Testing in
TestOps/sec
apply
Obj.prototype.target.apply(inst, ["YES"]);  
ready
call
Obj.prototype.target.call(inst, "YES");
ready
method call
inst.target("YES");
ready

Revisions

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