DEV Community

Discussion on: How would you refactor this JS function?

Collapse
 
calinbaenen profile image
Calin Baenen • Edited

understandable and readable is very hard in your solution.
Refactor is not to get code smaller.

Then I think the people who submitted those one-liners (Which are even harder to understand than my code!) misunderstood the point. :p

Thread Thread
 
rkallan profile image
RRKallan

the one line solutions with nested ternary expressions are also difficult to understand.

Thread Thread
 
rkallan profile image
RRKallan

Goals for refactoring code: readability, understandability, maintainability, performance, usage of latest code style / programming / functions / methods