Ruby Return statement

Ruby Return statement

The Ruby Return statement in method syntax and example.

Return syntax

while condition
	-- Ruby code 
end
--or
begin
	-- Ruby code 
end while condition

Return example

def test
   a = 1
   b = 2
   c = 3
   d = "xyz"
return a, b, c, d
end
puts test

Output

1

2

3

xyz