I just tried in NodeJS, you could also just instantiate an Array of a given length and join it with spaces, like this.
var x = new Array(5);x[4] = "abc";x.join(" ");
No idea if it could be faster - but the test you linked to pushes spaces into the Array.
I just tried in NodeJS, you could also just instantiate an Array of a given length and join it with spaces, like this.
var x = new Array(5);x[4] = "abc";x.join(" ");
No idea if it could be faster - but the test you linked to pushes spaces into the Array.