Home > front end >  Two dimensional array of js transpose
Two dimensional array of js transpose

Time:09-26

My novice, this how to do, to solve the

CodePudding user response:

 var arr=[
[" a ", "b", "c"),
[" d ", "e", "f"],
[" g ", "h", "I"],
[" j ", "k", "l"]
];
Var arr2=arr [0]. The map ((v1, x)=& gt; Arr. The map ((v2, y)=& gt; Arr [y] [x]));
console.log(arr2);

CodePudding user response:

reference 1/f, the sky wave response:
 var arr=[
[" a ", "b", "c"),
[" d ", "e", "f"],
[" g ", "h", "I"],
[" j ", "k", "l"]
];
Var arr2=arr [0]. The map ((v1, x)=& gt; Arr. The map ((v2, y)=& gt; Arr [y] [x]));
console.log(arr2);
I use two layers for make the I have just learned the I didn't understand you
  • Related