Mega Code Archive

 
Categories / Ruby / Statement
 

Upto with without {}

1.upto 3 do |x|   puts x end # 1 # 2 # 3 1.upto(3) { |x| puts x } # 1 # 2 # 3