Hacker News new | past | comments | ask | show | jobs | submit login

My solution for Javascript:

  function zip(arr_a, arr_b) {
    const len = arr_a.length < arr_b.length ? arr_a.length : arr_b.length;

    return arr_a.slice(0, len).map((el, idx) => [el, arr_b[idx]]);
  }



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: