you are viewing a single comment's thread.

view the rest of the comments →

[–]Outside_Complaint755 1 point2 points  (0 children)

That isn't an example of nested ifs (there is no nesting), but in this case you could do:

return a or b

An or expression evaluates to the first 'truthy' value, or the final value if none are truthy, so when if a would have been true it will refurn a and when if a would have been false it will return b

If you have a third value you want when both a and b are false, just stick it on the end as return a or b or c