String join vs String concat

Benchmark created on


Setup

const data = 'abcdefghijklmn '.repeat(10000).split('');

Test runner

Ready to run.

Testing in
TestOps/sec
join
const result = data.join('\n');
ready
concat
let result = "";
for(let i = 0; i < data.length; i++) {
	result += data[i];
}
ready

Revisions

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