vendredi 20 juillet 2018

A misunderstanding with IF statements and the OR & AND conditions- Swift

Let's say I have this code

if a > 0 || b > 0 && c > 0 {
    // Do something
}

Would this mean?

Option 1:

If a is more than zero,

or b and c are more than zero

Option 2:

If a is more than zero and c is more than zero,

or b is more than zero and c is more than zero

Aucun commentaire:

Enregistrer un commentaire