There are two ways to ensure a condition is met:
-
The simple way is using an
if
with the condition:if (condition) { /* execute code */ }
-
The other way is similar but I check for the negated condition and
return
if this is given:if (!condition) { return; } /* execute code */
Are there names for this patterns? I tried googleing it but was not successfull...
Aucun commentaire:
Enregistrer un commentaire