View Single Post
  #1  
Old 01-23-2007, 12:15 AM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Ternary Operator question..

Why doesn't this work:

variable ? function() : function2();

yet this does:

x = variable ? function() : function2();

The first example never gets processed. It's easier and neater than using

if (var) {
function();
}
else {
function2();
}
__________________

Coming soon (Hopefully:P)
Reply With Quote