jeudi 30 janvier 2020

Is there any turnery operator for just single if condition in dart?

In dart we have plenty of turnery operators. But do we have one turnery operator just for if condition?

Example

In condition

if(num == 1){
   print(true);
} else {
   print(false);
}

In turnery

print(num == 1 ? true : false );

So do we have any turnery operator just for true condition like above example?

if(num == 1){
   print(true);
}

Aucun commentaire:

Enregistrer un commentaire