Option 1, one return at the end. Best for debugging.
Option 2: early returns. I consider valuable when you have a simple condition that could be evaluated at the beginning and the rest of conditions are more complex, so you can save some precious cpu time haha
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.