Skip to main content
Known Participant
October 27, 2010
Answered

Argument I've never seen

  • October 27, 2010
  • 1 reply
  • 556 views

hey all, I am currently looking through code a former coworker wrote and he used the following:

_fade.startDelay = (show) ? 0 : 500;

I have never seen an argument written this way.  what does the (show) ? 0 : 500; actually say?

thanks,

This topic has been closed for replies.
Correct answer kglad

:


_fade.startDelay = (show) ? 0 : 500;


is the same as:

if(show){

_fade.startDelay=0;

} else {

_fade.startDelay=500;

}

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
October 27, 2010

:


_fade.startDelay = (show) ? 0 : 500;


is the same as:

if(show){

_fade.startDelay=0;

} else {

_fade.startDelay=500;

}

5SystemsAuthor
Known Participant
October 27, 2010

cool, Thanks

Oh and if (show) is the same as if (show = true)..... correct?

Ned Murphy
Legend
October 27, 2010

(show == true)