3 ms·
Not really, it's a nice shorthand for "exactly one of these must pass": x = checkFoo() y = checkBar() z = checkBaz() if (1 === (x + y + z)) { ...
by Izkata 5y ago
Not really, it's a nice shorthand for "exactly one of these must pass":
x = checkFoo()
y = checkBar()
z = checkBaz()
if (1 === (x + y + z)) {
....
}
It's a rare construction but I have used it intentionally once or twice in the past decade.