Skip to content

Instantly share code, notes, and snippets.

@barsbek
Created March 26, 2018 07:27
Show Gist options
  • Save barsbek/31c9fb5825b20752bf8d1061fa3c18b7 to your computer and use it in GitHub Desktop.
Save barsbek/31c9fb5825b20752bf8d1061fa3c18b7 to your computer and use it in GitHub Desktop.
ruby: group corresponding elements of arrays
[1,2,3].zip([5,6,7,9], [7]) #[[1, 5, 7], [2, 6, nil], [3, 7, nil]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment