Ruby - Methods
Which of the following Ruby method definitions returns
nil?nil?def multiply(x, y)
x * y
end returns x * y implicitly. def multiply(x, y)
x * y
return
end returns nil because return without value returns nil. def multiply(x, y)
x * y
return x * y
end returns x * y explicitly. def multiply(x, y)
x * y
return x * y
end returns x * y explicitly.nil due to the empty return.return returns nil [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions