Kopieren von array-Elemente in ein anderes array

Habe ich ein JavaScript-array dataArray was ich will Vorstoß in ein neues array newArray. Außer ich will nicht newArray[0] zu dataArray. Ich will schieben Sie alle Elemente in das neue array:

var newArray = [];

newArray.pushValues(dataArray1);
newArray.pushValues(dataArray2);
//...

oder noch besser:

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, jetzt das neue array enthält alle Werte der einzelnen Datenreihen. Gibt es ein Kürzel wie pushValues zur Verfügung, so dass ich nicht haben, um die Iteration über jede einzelne dataArray, indem die Elemente nacheinander?

InformationsquelleAutor bba | 2010-11-11
Schreibe einen Kommentar