DEV Community

Discussion on: Washing your code: avoid conditions

Collapse
 
dexterstpierre profile image
Dexter St-Pierre

Although I agree that the original example wasn't the most readable, I don't think that your example would scale very well. If you moved the declaration of the object out of the function (possibly to a different file) and access the value the way that Artem did I think you would have a much more readable function. But that's just my opinion :)