Logical "AND"

As we saw, in some tasks we have to make many checks at once. But what happens when in order to execute some code more conditions have to be executed and we don't want to make a negation (else) for each one of them? The option with nested if blocks is valid, but the code would look very unordered and for sure - hard to read and maintain.

The logical "AND" (operator &&) means a few conditions have to be fulfiled simultaneously. The following table of thruthfulness is applicable:

a b a && b
true
true
false
false
true
false
true
false
true
false
false
false

results matching ""

    No results matching ""