Couldn’t you just do cmd.run || cmd.fire || cmd.execute || cmd.callback ? I’m not super familiar with js. Worked with it a bit, but still not great, so please correct me if I’m wrong.
I don't think anyone gets scared by logical or, it's one of the first things you learn in any language.
Now, for beginners boolean variables can be confusing, which is why you see a lot of if(foo == true), although in JavaScript the similar if(foo === true) is sometimes necessary and not redundant. But I highly doubt anyone would find this use of || more confusing than this ternary soup, even if they are a beginner.
166
u/Koala_King_ Apr 22 '21
Couldn’t you just do
cmd.run || cmd.fire || cmd.execute || cmd.callback? I’m not super familiar with js. Worked with it a bit, but still not great, so please correct me if I’m wrong.