thanks everyone for your comments, yes in reallity I use the regular if
{}else{} statement, but I was wondering if there was something similar to
when you dont need the else statement, sort of testing on the fly....

but i think Mark made a good comment on use a return Boolean ( object );

I dont know why i figured that the shorthand was something most people were
used to and using already...

...helmut

On 1/26/07, John Mark Hawley <[EMAIL PROTECTED]> wrote:

For that specific example, you can usually turn lines like

return object ? true : null;

into

return Boolean( object );

as long as object != 0 and your code doesn't mind getting a false instead
of a null. Most objects, as long as they exist, evaluate to Boolean true.

Really, though, the ternary operator is confusing enough as is. It tends
to be a lot easier to read and maintain plain old if-statements in the long
run.

-John Mark Hawley


>
> From: "Helmut Granda" <[EMAIL PROTECTED]>
> Date: 2007/01/26 Fri PM 03:01:25 CST
> To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
> Subject: [Flashcoders] Shorhand for if statement without else statement
>
> does anybody knows if there is any short hand for if statement without
the
> else statement?
>
> at the moment I am using
>
> object ? true : null;
>
> thanks...
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>

--
John Mark Hawley
The Nilbog Group
773.968.4980 (cell)

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to