Join vs +=

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
+=
let text = '';

for(let i=0;i<10000000;i++) {
	text += 'test';
}
ready
join
let tokens = [];

for(let i=0;i<10000000;i++) {
	tokens.push('test');
}

let text = tokens.join('');
ready

Revisions

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