Writing out a Ternary line for a if else statement