A ternary operator takes three arguments. The first one is the condition, the second one is executed if the condition is true, and the third one is executed if the condition is false. In lf else just check for the condition in if part and if satisfies then good otherwise it goes for else part.