Good one! Although I personally prefer to avoid short-circuits for that very specific example. The if block enhances readability and also allows for future modifications easily.
I prefer this approach also! It's more readable, but I have already have discussions with other dev that like this short-circuits 😆
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Good one! Although I personally prefer to avoid short-circuits for that very specific example.
The if block enhances readability and also allows for future modifications easily.
I prefer this approach also! It's more readable, but I have already have discussions with other dev that like this short-circuits 😆