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 (X11; Ubuntu; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0
Browser:
Firefox 134
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
join
34451.6 Ops/sec
concat
39348.1 Ops/sec
using template literals
45321.7 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}`; }