Skip to content

Instantly share code, notes, and snippets.

@jessepollak
Created November 25, 2013 16:12
Show Gist options
  • Select an option

  • Save jessepollak/7643853 to your computer and use it in GitHub Desktop.

Select an option

Save jessepollak/7643853 to your computer and use it in GitHub Desktop.
array_1 = [1, 2, 3, 4]
array_2 = [1, 2, 3]
array_1.zip(array_2)
# => [[1, 1], [2, 2], [3, 3], [4, nil]]
array_2.zip(array_1)
# => [[1, 1], [2, 2], [3, 3]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment