The if operator is a mainstay of computer programming, we use it everywhere.
Sometimes we need to test a value to then, execute some simple code:
...
For further actions, you may consider blocking this person and/or reporting abuse
If we're really going for simplicity, in this particular case you can just say
adult = (age>=18)
since the A and B operations just give back the result of the condition.
Here's one example that better demonstrates the case:
result = (age>=18 ? "adult" : "young")
Cheers!
You don't need the brackets either 🙂
A great many people mistake a decrease in number of characters for an increase in clarity. Or to say it in another way: dense isn't the same as concise.
Yes as I said in the conclusion, this syntax isn't adapted in all case, only in really simple one