Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36
Chrome 63
Linux
Desktop
6 years ago
Test name Executions per second
concat() 3690.6 Ops/sec
plus_operator 3693.7 Ops/sec
plus_eq_operator 1283.6 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;
    }