ruby/break_v_return.rb
# Using return exits from the entire method.
#
# Using break exits only from that loop.
Using return exits from the entire method.
Using break exits only from that loop.
Using return exits from the entire method . Using break exits only from that loop .
def break_v_return(stop_number, r_v_b)
	(1..10).each do |number1|
		(1..10).each do |number2|
			puts product = number1 * number2
			if product >= stop_number
				return if r_v_b == "return"
				break if r_v_b == "break"
			end
		end
	end
end
def break_v_return ( stop_number , r_v_b ) ( 1 .. 10 ) . each do | number1 | ( 1 .. 10 ) . each do | number2 | puts product = number1 * number2 if product >= stop_number return if r_v_b == "return" break if r_v_b == "break" end end end end
Using return exits from the entire method.
Using return exits from the entire method .
stop_number
r_v_b