Skip to main content
Source Link

Ternary statements. They are generally much harder to read yet only save a few lines of code.

if (myCondition) {
    return firstAlternative();
}
return secondAlternative();

versus

return myCondition ? firstAlternative() : secondAlternative();
Post Made Community Wiki