Plus Operator (+) vs Concat (concat()) method

Benchmark created by Alex on


Preparation HTML

<script>
  var chars = 'dksajd8ffhjdsfhdksjfdsfdshfjkdshfdfdf'.split();
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
+ operator
var str = '';
for (var i = 0, charsLength = chars.length; i < charsLength; i++) {
 str += chars[i];
}
ready
concat method
var str = '';
for (var i = 0, charsLength = chars.length; i < charsLength; i++) {
 str.concat(chars[i]);
}
ready

Revisions

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