Created
April 3, 2023 12:47
-
-
Save TomNaessens/390e7b011c6571708e1d6a16911da4cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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