+ 3
Why use unless instead of an if statement?
3 Réponses
+ 15
If a conditional expression evaluates to true, the if code is carried out. Otherwise, the code is ignored.
On the other hand, the unless expression is the opposite of an if expression. It executes code when a conditional is false.
Both are useful for their own purposes. You can use any of them according to the need :]
+ 7
Kitty might like c++
+ 3
It just seems like you could use an if ! instead of an unless.