DEV Community

Discussion on: 5 ways to refactor if/else statements in JS functions

Collapse
 
johnylab profile image
João Ferreira • Edited

I like too use mapping objects for everything, but never put a default inside the function. So all my attention is driven to the object. If the function doesn't find a value in the object, it does nothing and returns null, if needed a value.

Thread Thread
 
johnylab profile image
João Ferreira

"too" was mistype, but let it be