repl.it
Ruby

No description

fork
loading
Files
  • main.rb
main.rb
1
2
3
4
5
6
7
def double(num)
  yield(num)
  yield(4) #doesn't matte te order
  yield(num) 
end

double(10){|i| puts "#{i*2} is the number"} #doubles a number
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]
?