ruby - How to return the value of the variable in the condition? -
code must return value of variable if value equal 42.
have 2 idea. variant choose?
# variant if foo == 42 return foo end # variant b if foo == 42 return 42 end
if foo==42 foo end
this do.
Comments
Post a Comment