I have some large data objects that come back to me in record formats, as an array of arrays. Column headings are in the array at index 0, and Row headings are in index 0 of each array. Sometimes, it will be necessary to translate (pivot) all of the records so that rows become columns and columns become rows.
For example:
const what_i_have = [
[1,1,1,1],
[2,2,2,2],
[3,3,3,3],
[4,4,4,4]
]
const what_i_need = [
[1,2,3,4],
[1,2,3,4],
[1,2,3,4],
[1,2,3,4]
]