Considering the evaluation time, are following two equivalent?
if(condition1) { //code1 } else { //code2 }
condition1 ? code
Yes & Yes.
Only profit is to save lines of code.