Skip to content

Instantly share code, notes, and snippets.

@kaochenlong
Created July 5, 2016 02:48
Show Gist options
  • Save kaochenlong/c6980b1d905608ac74ec845e31fd7359 to your computer and use it in GitHub Desktop.
Save kaochenlong/c6980b1d905608ac74ec845e31fd7359 to your computer and use it in GitHub Desktop.
p [*1..5].map { |i| i * 2 }
p ([*1..5].map { |i| i * 2 })
p [*1..5].map do |i| i * 2 end
p ([*1..5].map) do |i| i * 2 end
p ([*1..5].map do |i| i * 2 end)
def hello(x)
puts "hi"
if block_given?
yield x
end
puts "hello"
end
hello("kk") { |name| puts name }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment