DEV Community

Discussion on: Code Smell: No AND in Function name

 
andrejnaumovski profile image
Andrej Naumovski

You don't need to overload. Just make the function take a single object as an argument with optional properties, then filter out the undefined ones at the start.

Thread Thread
 
n1ru4l profile image
Laurin Quast

This becomes a mess when only certain object properties should be used together.

Thread Thread
 
seanmclem profile image
Seanmclem

If it takes a standard query object for what to filter by