Test name | Executions per second |
---|---|
using plus operator | 29889736.0 Ops/sec |
using concat function | 330563.0 Ops/sec |
using template literals | 5656679.5 Ops/sec |
var name = "name";
var id = "id";
for (let i = 0; i < 80; ++i) {
let result = id + ": 1, " + name + ": someItem";
}
for (let i = 0; i < 80; ++i) {
let result = "".concat(id, ": 1, ", name, ": someItem");
}
for (let i = 0; i < 80; ++i) {
let result = `${id}: 1, ${name}: someItem`;
}