Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
JavaScript String Concatenation: String Append vs String.prototype.concat vs Array.prototype.join
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:147.0) Gecko/20100101 Firefox/147.0
Browser:
Firefox 147
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
6 months ago
Array.prototype.join
392K/s
String.prototype.concat
332K/s
String Append
305K/s
View exact numbers
Test name
Executions per second
✓
Array.prototype.join
392,022 Ops/sec
String.prototype.concat
331,741 Ops/sec
String Append
305,320 Ops/sec
Script Preparation code:
const array = []; for (let i = 0; i < 1024; i++) array.push(i.toString());
Tests:
String Append
let str = ""; for (const i of array) str += i;
String.prototype.concat
const str = "".concat(...array);
Array.prototype.join
const str = array.join("");