How to early return in Scala [duplicate]
问题 This question already has answers here : Explicit return from play action (2 answers) Closed 3 years ago . I am learning Scala at the moment. One thing that I like to do is early returns. I'm convinced that this is far easier for everyone to read as we just remove the invalid states before. Now, as Scala is a functional language and I've read that cutting computation is bad functional style, I'm wondering if there is some trick or functional programming equivalent to early return. This is