export function zip < T > ( arrays ) { return arrays . length > 0 ? arrays . reduce ( ( prev , curr ) => ( prev . length < curr . length ? prev : curr ) ) . map ( ( _ , i ) => arrays . map ( ( array ) => array [ i ] ) ) : [ ] ; } export function inherit ( ) { Array . prototype . zip = function < T > ( ... arrays ) : T [ ] [ ] { return zip ( [ this , ... arrays ] ) ; } ; } export default zip ;