DEV Community

Discussion on: How would you refactor this JS function?

Collapse
 
nombrekeff profile image
Keff

Great point on overengineering, I must admit the last solution could be a bit overengineered. That's the reason I would need to check the full code base and see the real use of this function.

I too prefer simplicity in general, so I would probably go for the first example.