samedi 6 février 2016

Breaking out of shorthanded if statement [duplicate]

I like to use shorthanded "if statements" of the format

if-condition?then-statement:else-statement

Whys is it that this works...

if (num==0)break;else continue;

And this doesn't?

num==4?break:continue;

Seeing as the two statements are logically equivalent.

Aucun commentaire:

Enregistrer un commentaire