The question has already been answered, however, when I first saw it, I thought about NodeJS Buffer. But this is slower than +, therefore, most likely, nothing can be faster than + in line consonation.
Tested with the following code:
function a(){ var s = "hello"; var p = "world"; s = s + p; return s; } function b(){ var s = new Buffer("hello"); var p = new Buffer("world"); s = Buffer.concat([s,p]); return s; } var times = 100000; var t1 = new Date(); for( var i = 0; i < times; i++){ a(); } var t2 = new Date(); console.log("Normal took: " + (t2-t1) + " ms."); for ( var i = 0; i < times; i++){ b(); } var t3 = new Date(); console.log("Buffer took: " + (t3-t2) + " ms.");
Exit:
Normal took: 4 ms. Buffer took: 458 ms.
Mustafa Dec 14 2018-12-12T00: 00Z
source share