<code>Concatenation</code> significa unir elementos de extremo a extremo. JavaScript ofrece el método <code>concat</code> para cadenas y matrices que funcionan de la misma manera. Para las matrices, el método se llama en una, luego se proporciona otra matriz como el argumento a <code>concat</code> , que se agrega al final de la primera matriz. Devuelve una nueva matriz y no muta ninguna de las matrices originales. Aquí hay un ejemplo:
<blockquote>[1, 2, 3].concat([4, 5, 6]);<br>// Returns a new array [1, 2, 3, 4, 5, 6]</blockquote>
Utilice el método <code>concat</code> en la función <code>nonMutatingConcat</code> para concatenar <code>attach</code> al final del <code>original</code> . La función debe devolver la matriz concatenada.