Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36
Chrome 101
Mac OS X 10.15.4
Desktop
2 years ago
Test name Executions per second
using plus operator 95474.4 Ops/sec
using concat function 84034.9 Ops/sec
using template literals 95149.3 Ops/sec
Script Preparation code:
AخA
 
var name = "name";
var id = "id";
Tests:
  • using plus operator

     
    for (let i = 0; i < 80; ++i) {
      let result = id + ": 1, " + name + ": someItem";
    }
  • using concat function

     
    for (let i = 0; i < 80; ++i) {
      let result = "".concat(id, ": 1, ", name, ": someItem");
    }
  • using template literals

     
    for (let i = 0; i < 80; ++i) {
      let result = `${id}: 1, ${name}: someItem`;
    }