Test name | Executions per second |
---|---|
using plus operator | 41302.1 Ops/sec |
using concat function | 36426.3 Ops/sec |
using template literals | 40823.1 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`;
}