DEV Community

Discussion on: Keeping your code clean by sweeping out "if" statements

Collapse
 
dexster profile image
dexster

I think the real value of the Map approach is that it follows the open/close principle. You could pass the map into your function instead of adding if statements directly in the function whenever a new business requirement surfaces