join/concat (v43)

Revision 43 of this benchmark created by Piet on


Description

use concat(), not '+'

Preparation HTML

<script>
  var str = 'string';
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
concat
  var a = ''.concat('this', ' is', ' a', str, ' to', ' test', ' if', ' there', ' is', ' any', ' difference', ' between', ' concat', ' and', ' join');
 
ready
join
  var barr = ['this', ' is', ' a', str, ' to', ' test', ' if', ' there', ' is', ' any', ' difference', ' between', ' concat', ' and', ' join'];
var a = barr.join('');
ready

Revisions

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