Short syntax of if : else

Short syntax of if : else

I always tend to forget this simple, neglected row.

var _b: Boolean = true;
var _n: int;
_b ? _n = 0 : _n = 1;


2 Comments

sergejmueller

_n = b ? 0 : 1;

is a lot more readable.

Herr Åhman

Ofcourse, thanks!

Please leave a comment.



Design by AMY&PINK.