be careful with ternaries...depending on the implementation. As pointed out, the best use of a ternary is when setting a variable...however a ternary needs to have both values evaluated for optimizing the operation...hence you might be executing the else branch regardless of whether the condition is true or false...