I am trying to convert this:
[ [1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12] ]
in it:
[ [1, 5, 9], [2, 6, 10], [3, 7, 11], [4, 8, 12] ]
Is there a built-in function for this? If this is not so, then what is shorter and cleaner?
The built-in method you're looking for is Array # transpose
Source: https://habr.com/ru/post/1758108/More articles:jQuery draggable: access an item being dragged while dragging - jquery-uiВнедрение API пользовательского интерфейса Google через Greasemonkey - javascriptHow to activate an external application window - c ++refresh part of HTML page with jquery - jquerymysql search 'No' no no. ' or not"; - mysqlWhy is the following program giving an error? - c ++iPhone Dev, background color UITableView - colorsBuggy Behavior Using Canvas? - javascriptSoftware Definition of NSSegmentedCell - objective-chash increment value - ruby | fooobar.comAll Articles