call vs apply (v33)

Revision 33 of this benchmark created on


Setup

function Obj() {
          var that = "that";
    }
    Obj.prototype.target = function(test) {
       return test;
    };
    var yes_array = ["YES"];
    var yes_string = "YES";

Test runner

Ready to run.

Testing in
TestOps/sec
apply
Obj.prototype.target.apply(this, ["YES"]);  
ready
call
Obj.prototype.target.call(this, "YES");
ready
apply, existing array
Obj.prototype.target.apply(this, yes_array);
ready
call, existing string
Obj.prototype.target.call(this, yes_string);
ready

Revisions

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