0
What is the point of writing both if and unless espressions?
In ruby sololearn unless and if expressions section they use both if and unless expressions. Was it just to give an example of both or was it for a specific reason?
2 odpowiedzi
+ 4
It is an example, which explains those concepts (and difference between them) more clearly. Using both or either one of them depends on you and your code requirements.
Remember, the unless expression is the opposite of an if expression. It executes code when a conditional is false.
0
Thank you that was very helpful