The classic if .. else .. statement represented as:
if (x == 1)
{
  x = 2;
}
else
{
  x = 3;
}
can be condensed to:
x = (x==1) ? 2 : 3;
Â
The classic if .. else .. statement represented as:
if (x == 1)
{
  x = 2;
}
else
{
  x = 3;
}
can be condensed to:
x = (x==1) ? 2 : 3;
Â