To concatenate N arrays with JavaScript, we use the spread operator and push
.
For instance, we write
const a = [1, 2],
b = ["x", "y"],
c = [true, false];
a.push(...b, ...c);
to call a.push
with the entries from b
and c
spread as arguments to put the entries into a
.