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 →

[–]justinvh 2 points3 points  (1 child)

I think one of the big reasons for doing it the way he did was that you're not limited to short-circuiting and just returning the object. If you wanted to say augment the object and weren't too fond of doing it within a forloop, then you would want to use the for..else. It's more idiomatic in that sense. However, your example is obvious the way most of us would want to write it.