Skip to main content
Module

x/rambda/transpose.js

Faster and smaller alternative to Ramda
Go to Latest
File
import { _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 }, [])}