all elements of as must be of type A. all elements of bs must be of type B. you can do this using recursion and you wouldn't have to know about the lengths of the arrays but that's for another gist.
const zip = <A, B>(as: A[], bs: B[]) => {
  const length = Math.min(as.length, bs.length);
  return Array.from({ length }, (_, i) => [as[i], bs[i]]);
};