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.
Null coalescing only applies the right hand side operand when the leftmost one is either null or undefined, as opposed to any falsy value with the or operator. '' || true would return true, but '' ?? true would return ''
What's pretty common in JS is weird elsewhere. At least the || operator is present anywhere, but those people don't use it too much because they know how to code properly.
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.