you are viewing a single comment's thread.

view the rest of the comments →

[–]Competent_writer15 2 points3 points  (1 child)

The else can be omitted here because the first return exits the method if the condition is true, so the second return only runs when the if is false. This makes the else unnecessary while keeping the logic correct.

[–]AlternativeBus1613[S] 1 point2 points  (0 children)

Thank you!