SyntaxFix
Write A Post
Hire A Developer
Questions
cond? statementA: statementB
Equals to:
if (cond) statementA else statementB
For your case, you may just delete all "if". If you totally use if-else instead of ?:. Don't mix them together.