Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save TomNaessens/390e7b011c6571708e1d6a16911da4cc to your computer and use it in GitHub Desktop.
Save TomNaessens/390e7b011c6571708e1d6a16911da4cc to your computer and use it in GitHub Desktop.
irb(main):012:0> [1, 2, 3].to_enum.lazy.zip([:a, :b, :c]).eager.map { |*x| x.last }.to_a
=> [[1, :a], [2, :b], [3, :c]]
irb(main):013:0> [1, 2, 3].to_enum.lazy.zip([:a, :b, :c]).map { |*x| x.last }.to_a
=> [:a, :b, :c]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment