Script Preparation code:
AخA
 
var A = null;
var B = 'test';
Tests:
  • join

     
    var result = [A | '' , B | ''].join(' ');
  • string + trim

     
    var result = `${A | ''} ${B | ''}`.trim();
  • filter + joint

     
    var result = [A, B].filter(Boolean).join(' ');
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    join
    string + trim
    filter + joint

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 OPR/84.0.4316.21
Opera 84 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
join 2562171.5 Ops/sec
string + trim 3419861.2 Ops/sec
filter + joint 1983404.8 Ops/sec