Skip to main content
Module

x/rambda/zip.js

Faster and smaller alternative to Ramda
Go to Latest
File
export function zip(left, right){ if (arguments.length === 1) return _right => zip(left, _right)
const result = [] const length = Math.min(left.length, right.length)
for (let i = 0; i < length; i++){ result[ i ] = [ left[ i ], right[ i ] ] }
return result}