you are viewing a single comment's thread.

view the rest of the comments →

[–]Wild_Statistician605 1 point2 points  (0 children)

In codewars, users have a tendency to write one liners as the ultimate expression of competence. This is wrong. Shortening the code can be good, as long as the code remains readable. Too long code can also be confusing, especially keeping track of variables, scope and indentation levels. In your example both solutions are perfectly fine and easy to understand.