This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zip = (arr1, arr2) -> | |
basic_zip = (el1, el2) -> [el1, el2] | |
zip_with basic_zip, arr1, arr2 | |
# I wrote two implementations of `zipWith`: one is iterative, and one is recursive. Feel free to do some benchmarks if you feel like it :) | |
# zip_with, iterative style | |
zip_with = (func, arr1, arr2) -> | |
min = Math.min arr1.length, arr2.length | |
ret = [] |
NewerOlder