Native JS: concatenate string with + vs template literals vs String.concat
find best solution for concatenate 4 strings
2 months ago
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Test name |
Executions per second |
using plus operator |
77932.6 Ops/sec |
using concat function |
73934.7 Ops/sec |
using template literals |
76843.3 Ops/sec |
Tests:
-
using plus operator
-
using concat function
-
using template literals
Open this result on MeasureThat.net