Ruby - Methods
What is the issue with this Ruby method regarding its return value?
def calculate x = 4 y = 5 x * y puts 'Finished' end
def calculate x = 4 y = 5 x * y puts 'Finished' end
puts 'Finished', which returns nil.puts is last, the method returns nil, not x * y.puts is the last expression -> Option A15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions