Zip applies a specified function to the corresponding elements of two sequences, producing a sequence of the results.
arrayA
(Array): input arrayArrayB
(Array): input array[func=(a,b)]
(Function): to be applied to corresponding values
(Array): input array filled value pairs after the function has been applied
const result = zip([5, 12, 8, 130, 44], ["ham", "cheese", "bread"]);
console.log(result)
> [ [ 'ham', 5 ], [ 'cheese', 12 ], [ 'bread', 8 ] ]