Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
Chrome 73
Linux
Desktop
6 years ago
Test name Executions per second
concat() 7053.0 Ops/sec
plus_operator 7143.3 Ops/sec
plus_eq_operator 2692.4 Ops/sec
Script Preparation code:
AخA
 
var string1 = "Hello ";
var string2 = " world!";
Tests:
  • concat()

     
    for(i = 0; i < 1000; i++) {
      var message = string1.concat(string2);
    }
  • plus_operator

     
    for(i = 0; i < 1000; i++) {
      var message = string1 + string2;
    }
  • plus_eq_operator

     
    for(i = 0; i < 1000; i++) {
      string1 += string2;
    }