Javascript – TypeScript definitions for `zip` and `zipObj` functions
I would like to combine/reuse the type definitions for the following functions. const zip = <T, K>(arr1: readonly T[], arr2: readonly K[]): Array<[T, K]> => arr1.map((k, i) => [k, arr2[i]]) const zipObj = <T extends string, K>(arr1: readonly T[], arr2:…