Skip to content

Instantly share code, notes, and snippets.

@capoferro
Created December 8, 2011 02:48
Show Gist options
  • Save capoferro/1445893 to your computer and use it in GitHub Desktop.
Save capoferro/1445893 to your computer and use it in GitHub Desktop.
# Equivalent to puts( (1..10).map { |i| i*2 } )
> puts (1..10).map { |i| i*2 }
2
4
6
8
10
12
14
16
18
20
=> nil
# Equivalent to puts( (1..10).map ) { |i| i*2 }
> puts (1..10).map do |i| i*2 end
#<Enumerator:0x928f24>
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment