Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Native JS: Array.join strings vs template literals vs String.concat
find the best solution for concatenate strings
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Browser:
Chrome 121
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
join
35553.7 Ops/sec
concat
67810.2 Ops/sec
using template literals
87164.4 Ops/sec
Script Preparation code:
var name = "name"; var id = "id";
Tests:
join
for (let i = 0; i < 80; ++i) { let result = [id, ':', i, ', ', name, ':', 'name', i].join(); }
concat
for (let i = 0; i < 80; ++i) { let result = "".concat(id, ':', i, ', ', name, ':', 'name', i); }
using template literals
for (let i = 0; i < 80; ++i) { let result = `${id}:${i}, ${name}:name${i}`; }