Reputation: 2970
Are all calls happening even if the first returns false? Is the second one waiting for the first one?
if (await callAsync() && await callAsync()) {...}
if (await callAsync() & await callAsync()) {...}
if (await callAsync() || await callAsync()) {...}
Upvotes: 4
Views: 78
Reputation: 1064184
In both cases, the calls still happen sequentially in the execution flow, not in parallel. In the first case the second call only happens if the first returns true
; in the second case, both will happen either way (assuming no exceptions are thrown).
Upvotes: 8