I have a multidimensional array which can contain a different number of arrays. What I want to do is to match all arrays in order of key not value, and produce a new array for each row created, something like this
var arr = [
[1,2,3,4,5],
[1,2,3,4,5],
[1,2,3,4,5],
[1,2,3,4,5]
]
The result I need
var arr = [[1,1,1,1],[2,2,2,2],[3,3,3,3],[4,4,4,4],[5,5,5,5]]
how can I achieve this?