Created
November 26, 2018 21:23
-
-
Save raws/07002f33ff6cd2e0b6c638dc627ad3e5 to your computer and use it in GitHub Desktop.
Ruby array block argument splatting
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
[['foo', 'bar', 'baz']].each { |array| puts array.inspect } | |
#=> ["foo", "bar", "baz"] | |
[['foo', 'bar', 'baz']].each do |first, second, third| | |
puts first.inspect | |
puts second.inspect | |
puts third.inspect | |
end | |
#=> "foo" | |
#=> "bar" | |
#=> "baz" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment