DEV Community

Discussion on: How would you refactor this JS function?

Collapse
 
juliogc profile image
Júlio Gori Corradi • Edited

I was looking below and there are good examples very similar to what came to my mind but what I'm thinking right now is why anyone doesn't get bothered by the function name?!

The function is called lineChecker but the main responsibility is to return a well-formatted line.

So the main change that I can purpose here is to call it lineFormatter!