|
|
|
|
|
by hobozilla
3994 days ago
|
|
"The OR adds mental overhead for whoever works on the function in the future" What world is this guy living in? It's like it's the first time he's seen this and just decided "I don't like it, let me write an article about that". Anyone working in JS for more than a month will have seen this as common practice. It much neater (and less mental headspace IMHO) than an extra if block. Particularly if you have more than one optional variable. The only practical consideration raised is the falsy types can trip you up but that is easily negated. I have strong negative feelings for people who impose their own personal believes based on nothing but their feelings. |
|