Skip to content

Instantly share code, notes, and snippets.

@tcopeland
Created September 21, 2013 23:36
Show Gist options
  • Save tcopeland/6655236 to your computer and use it in GitHub Desktop.
Save tcopeland/6655236 to your computer and use it in GitHub Desktop.
# Use Kernel#tap
# wrong
x = [1,2]
x << 3
return x
# right
[1,2].tap {|y| y << 3 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment