Argument join

Benchmark created by Gijs on


Description

Compare slice + join vs. join apply

Preparation HTML

<script>
  function testSlice() {
   var args = [].slice.call(arguments, 0);
   return args.join('###');
  }
  
  function testJoin() {
   return [].join.call(arguments, '###');
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Slice
testSlice(1, "foo", "baz");
testSlice("foo", "loooooooooooooooooooooooooong");
ready
Join
testJoin(1, "foo", "baz");
testJoin("foo", "loooooooooooooooooooooooooong");
ready

Revisions

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