Created
August 12, 2014 06:20
-
-
Save tkfm-yamaguchi/db2d17ef78c8aad922fd to your computer and use it in GitHub Desktop.
Array#tap mistery
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
# Array#tap mistery | |
array = [].tap do |array| | |
array << [1,3] | |
end | |
p array #=> [[1,3]] | |
array = [].tap do |array| | |
array += [1,3] | |
end | |
p array #=> [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment