Returning Multiples Values from a Method
# Ruby uses arrays to return multiple values.
# To return multiple values, all you have to do is to separate them with a comma: return a, b, c
def greeting()
return "No", "worries"
end
array = greeting
puts array.join(" ")
Related examples in the same category