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