Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

question on '?' and ':' in a statement

Status
Not open for further replies.

cat5ive

MIS
Dec 3, 2004
184
US
Hi,

Can someone please kindly explain what is this statement doing? I know that if you use '?' in 'if' statement, then it means if-else. But I have no idea what this statement doing.
Code:
var evt = (evt) ? evt : event

Thanks in advance
 
If evt is true, then return evt, otherwise return event.

var evt is set equal to what this "tertiary" statement returns (either evt or event).

Does this help?

--Dave
 
thats not valid Java code BTW ... looks more like Javascript ?!

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top