call vs apply (v14)

Revision 14 of this benchmark created on


Setup

function Obj() {
          var that = "that";
    }
    Obj.prototype.target = function(test) {
       return test;
    };
    var inObj = new Obj();
    var arr = ["YES"];
    var fn = function(test) {
       return test;
    };

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
normal
inObj.target( 'YES' );
ready
Fn Apply
fn.apply(this, ["YES"]);  
ready
Fn Apply Arr
fn.apply(this, arr);  
ready
Fn Call
fn.call(this, "YES");  
ready

Revisions

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