3 ms·
def double(number) return number * 2 end double(10) # => 20 double("foo") # => "foofoo" It's called polymorphism. `*` is a method. Learn how the language
by hawleyal 14y ago
def double(number)
return number * 2
end
double(10)
# => 20
double("foo")
# => "foofoo"
It's called polymorphism. `*` is a method.
Learn how the language works before you write an article about it proclaiming your ignorance.