4

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()) {...}

1
  • 1
    If the first condition returns false then rest all conditions arent checked. Short-circuting Commented Mar 31, 2020 at 14:03

1 Answer 1

8

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).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.