riyaz01
04-26-2003, 03:29 PM
Can anyone tell me what the ? and : operators do in this code:
function A(s, u)
{ var t=-1, B;
text[s][f]=-1;
while( ++t <= e && text[s][f]==-1 )
{ B = t==0 ? c : (t==1 ? d : (t==2 ? b : e)); // what do the ? and : operators do?????? :(
r( s, B, u );
if ( text[s][g] > 0 )
{ text[s][f] = B; }
}
}
Many Thanks in Advance,
Riyaz01.
function A(s, u)
{ var t=-1, B;
text[s][f]=-1;
while( ++t <= e && text[s][f]==-1 )
{ B = t==0 ? c : (t==1 ? d : (t==2 ? b : e)); // what do the ? and : operators do?????? :(
r( s, B, u );
if ( text[s][g] > 0 )
{ text[s][f] = B; }
}
}
Many Thanks in Advance,
Riyaz01.