There are two ways to ensure a condition is met:
-
The simple way is using an
ifwith the condition:if (condition) { /* execute code */ } -
The other way is similar but I check for the negated condition and
returnif 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