next Skips to the end of the current iteration (which makes the loop or iterator skip on to the next iteration or item). : next « Statement « Ruby






next Skips to the end of the current iteration (which makes the loop or iterator skip on to the next iteration or item).



-10.upto(10) do |number|
  next if number == 0
  puts "1/" + number.to_s + " = " + (1 / Float(number)).to_s
end

 

Related examples in the same category