UNPKG

moy-fp

Version:
19 lines (16 loc) 333 B
import curry from '../Function/curry' /** * [b] -> [a] -> [[a, b]] */ const zip = curry( (list2, list1) => { const list = [], length = Math.min(list1.length, list2.length) let index = 0 while(index < length){ list.push([list1[index], list2[index ++]]) } return list } ) export default zip