Here is my code:
case input
when "quit" || "exit"
break
end
Only "quit" works here and not "exit".
How could I have "exit" work too without having to have a new "when" line?
Here is my code:
case input
when "quit" || "exit"
break
end
Only "quit" works here and not "exit".
How could I have "exit" work too without having to have a new "when" line?
||
operator evaluates the latter when the former is nil. "quit"
is not nil. So "quit" || "exit"
is "quit"
.