apply() vs call()

Benchmark created on


Description

Function.prototype.apply() vs Function.prototype.call()

Preparation HTML

<script>
  var fn = function(arg) {
   // do nothing
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
apply()
fn.apply(window);
ready
call()
fn.call(window);
ready
apply() with arg
fn.apply(window, [1]);
ready
call() with arg
fn.call(window, 1);
ready

Revisions

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