concat vs + vs join (v35)

Revision 35 of this benchmark created by Luiz Tanure on


Description

How to concat strings faster.

Setup

var words = ['Coucou ', 'c\'est ', 'nous !'];

Test runner

Ready to run.

Testing in
TestOps/sec
concat
'Coucou '.concat('c\'est ', 'nous !');
ready
+
'Coucou ' + 'c\'est ' + 'nous !';
ready
join
['Coucou ', 'c\'est ', 'nous !'].join();
ready
join 2
words.join()
ready

Revisions

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