Early Return
Possible way to solve nested if statements. Basically just return if the result the negative of the clause in the if statements. Reference:
Copy and paste this URL into your WordPress site to embed
Copy and paste this code into your site to embed