SyntaxFix
Write A Post
Hire A Developer
Questions
All you'd need in your case is:
return expression;
The reason why is that the expression itself evaluates to a boolean value of true or false, so it's redundant to have an if block (or even a ?: operator).
true
false
if
?: