samedi 15 août 2020

Is there any idea to not use if statements like that --> if(myFunc()) {}

I am wondering that are there any best practice for those choices? Also I am currently use Flutter-Dart and I am asking for this.

final bool result = await myFunc();
if (result) {
    doSomething();
}

if (await myFunc()) {
    doSomething();
}

Thanks, best.

Aucun commentaire:

Enregistrer un commentaire