You can't possibly be arguing that saving the 2 or 3 minified bytes from writing ,0 or ,'' or the amount of processing power required to add zero to something is somehow worth the likelihood of your code taking a single input type and outputting two unrelated types or throwing an error?
I notice your reverseStr function from your other comment suffers from this problem — did you realize that when you wrote it?
Being 'hard to reason about' is purely subjective, and down to the individual. It's a perfectly valid language feature that has a valid use.
You can't possibly be arguing that saving the 2 or 3 minified bytes from writing
,0
or,''
or the amount of processing power required to add zero to something is somehow worth the likelihood of your code taking a single input type and outputting two unrelated types or throwing an error?I notice your
reverseStr
function from your other comment suffers from this problem — did you realize that when you wrote it?Yes