I’ve just realized that array.concat creates a copy of the array and returns it. This requires an additional assignment, something I was never fond of.
Isn’t this less efficient than the following code which can be hosted in an Array static extension?
for (newElement in elements) array.push(newElement);
I’m probably missing something because if the above would have been more efficient, I’m pretty sure it would have been in Std since ages ago .
In other words, why does array.concat create another copy?