The use case for this is rarer, but it's in Haskell and I do sometimes need it. When I do, it's just on the server side, so this is what I've been using:
transpose = (array) ->
Object.keys(array[0])
|> map (column) ->
array |> map (row) -> row[column]
Since Object.keys isn't supported in <IE9 (I think that's the one), we'd probably need a more lengthy implementation.
The use case for this is rarer, but it's in Haskell and I do sometimes need it. When I do, it's just on the server side, so this is what I've been using:
Since
Object.keysisn't supported in <IE9 (I think that's the one), we'd probably need a more lengthy implementation.