I have a function that returns an integer, however I would like to expand it to add a new param to it. With this param, however, the function would have to return an array.
- Is it bad practice to have a function that returns either an array or an integer based on a param?
- If so, how can I solve this?
I think it would be bad practice also to just copy-paste the entire function for 4-5 extra lines.