Hi there!
I just ran into this little problem which is pretty superficial, but i simply dont know the answer to it.
I want to replace several simple ‘if’ statements with conditional operators (? : ), but there is no ELSE statement.
Right now i have a solution as defined below, but it’s pretty ugly…
Is there a standard way to define this?
public function addDays(daysAdded:Number):DateDeluxe
{
/*
if ( daysAdded == undefined )
{
daysAdded = 0;
}
*/
daysAdded = (daysAdded == undefined) ? 0:daysAdded;
etc...
I was thinking more about something like this:
daysAdded = (daysAdded == undefined) ? 0;
But it seems that this isnt valid code.
Greets and eternal infamy for those that can help me
Flashkiddy!