Be aware that condition is a Boolean already, by virtue of fitting in the if statement. It's not elegance I wanted to demonstrate, I just wanted to raise type awareness.
I'll be keen to write a little explanation if I'm ever tempted to reply with a line of code like this :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Sorry I should have explained why I posted that.
If you have a piece of code of the form:
Be aware that
condition
is a Boolean already, by virtue of fitting in the if statement. It's not elegance I wanted to demonstrate, I just wanted to raise type awareness.I'll be keen to write a little explanation if I'm ever tempted to reply with a line of code like this :)