Noted that this is already commented elsewhere, but your binary conditional operator seems a lot like this logic operator abuse in JS:
condition && positive || negative // === (condition && positive) || negative // === condition ? positive : negative
And whenever I see the former I rewrite it as the latter (because it is more semantic, not because I am obsessed with removing 2 characters)
(Also, a falsy positive would cause negative to be evaluated and returned)
positive
negative
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
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.
Noted that this is already commented elsewhere, but your binary conditional operator seems a lot like this logic operator abuse in JS:
And whenever I see the former I rewrite it as the latter (because it is more semantic, not because I am obsessed with removing 2 characters)
(Also, a falsy
positive
would causenegative
to be evaluated and returned)