3 ms·
Why would you make a boolean parameter also an optional?
by heavyset_go 5y ago
Why would you make a boolean parameter also an optional?
- eyelidlessness 5y agoIt’s really common in JS. Typically the default is false, but an unreasonably large minority including some really notable cases default true… which makes it that much worse.
- Zababa 5y agoYou write a function that does one thing, and then you realise it can be used for something else that's almost the same thing, so you add an optional boolean parameter.