call vs apply (v93)

Revision 93 of this benchmark created on


Setup

var a = [ function(arg) {
      var string = "arg: " + arg;
      return string;
    },
    function(arg) {
      var string = "arg: " + arg + "typeof this: "  + (typeof this);
      return string;
    }]

Test runner

Ready to run.

Testing in
TestOps/sec
Call
a[0].call(null,"hi");
ready
Apply
a[0].apply(null,["hi"]);
ready
Indirect call
(0,a[0])("hi")
ready
direct call
a[0]("hi")
ready
Call (this)
a[1].call(null,"hi");
ready
Apply (this)
a[1].apply(null,["hi"]);
ready
Indirect call (this
(0,a[1])("hi")
ready
Direct call (this)
a[1]("hi")
ready

Revisions

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