I have a JavaScript array
dataArray
which I need to drive into another array
newArray
. But I don't need
newArray[0]
to be
dataArray
. I need to push in every one of the items into the new array:
var newArray = [];
newArray.pushValues(dataArray1);
newArray.pushValues(dataArray2);
// ...
or even better:
var newArray = new Array (
dataArray1.values(),
dataArray2.values(),
// ... where values() (or something equivalent) would push the individual values into the array, rather than the array itself
);
So now the new array contains every one of the values of the individual data arrays. Is there some shorthand like
pushvalues
accessible so I don't need to repeat over every individual
dataArray
, adding the things individually?