[].slice.call vs [].forEach.call

Benchmark created by Jonathan Wilsson on


Setup

var data = ['a', 'b', 'c', 'd'];

Test runner

Ready to run.

Testing in
TestOps/sec
[].slice.call
[].slice.call(data).forEach(function () {});
ready
[].forEach.call
[].forEach.call(data, function () {});
ready

Revisions

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

  • Revision 1: published by Jonathan Wilsson on