Created
July 5, 2016 02:48
-
-
Save kaochenlong/c6980b1d905608ac74ec845e31fd7359 to your computer and use it in GitHub Desktop.
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
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