letnext = arrConcat(values, ["a", "b"]); // next is [1, 2, 3, "a", "b"] // values is still [1, 2, 3]
Example
constleft = [1, 2]; constright = [3, 4]; constmerged = arrConcat(left, right, 5); // merged is [1, 2, 3, 4, 5] // left is still [1, 2] // right is still [3, 4]
Alias of
Array.prototype.concat()for consumers that prefer thearr*helper naming.Unlike arrAppend, this helper does NOT mutate the input arrays and returns a new array.
Since
0.15.0
Param: theArray
The array to concatenate into a new array.
Param: items
Additional arrays and/or items to concatenate.
Returns
A new array containing values from
theArrayfollowed by each concatenated item.Example
Example