looking to add a single array into a multidimensional array or an array of arrays.
for example:
Data = ["A","B","C","D"];
NewData =[[1,2,3,4],[5,6,7,8],[9,10,11,12]];
CombinedData = [];
for(i=0; i< NewData.length; i++){
CombinedData.push(...Data,NewData[i]);
}
However the above results in this:
“CombinedData =[[“A”,”B”,”C”,”D”],[1,2,3,4],[“A”,”B”,”C”,”D”],[5,6,7,8],[“A”,”B”,”C”,”D”],[9,10,11,12],[“A”,”B”,”C”,”D”]….]”
Where what I am looking for is this:
“CombinedData =[[“A”,”B”,”C”,”D”,1,2,3,4],[“A”,”B”,”C”,”D”,5,6,7,8],[“A”,”B”,”C”,”D”,9,10,11,12],]”
This is in ExcelScripts or office scripts which I know is pretty new but just looking for some sort of direction.