If I have:
bool foo = false; bool bar = true;
If(foo && bar)
Doea the if-statement check if bar is true or does it skip it because foo already is false?
What you are referring to is called short-circuit evaluation, and whether it will happen depends on:
Note that it is not a property of the if
statement, which is just taking a single boolean expression which has resulted from you using logical operators; the expression could equally be assigned to a boolean variable, passed as a function parameter, etc.