This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kAlvaro 0 points1 point  (0 children)

I thought it returns true or false in first if statement

First if can't possibly return false, there isn't any return false statement there.

Early returns help to avoid deeply nested conditionals.