x/rambda/transpose.js
1234567891011import { _isArray } from './_internals/_isArray'export function transpose(array){ return array.reduce((acc, el) => { el.forEach((nestedEl, i) => _isArray(acc[ i ]) ? acc[ i ].push(nestedEl) : acc.push([ nestedEl ])) return acc }, [])}