Interesting article.

I do have a few comments. Hope its not taken as criticism.

I always had been taken a back by the erroneoous usage of the term
"ternary condition" for the ? operator.   The ? is called the
Conditional Operator and it provides binary logic.  By definition,
Ternary is three, not two.  Binary provides a  true or false execution
path.  A ternary path is true, false or "maybe" which is normally
called Fuzzy Logic.

Also, in the paragraph discussing:

         condition == true ? foo() && bar() && something() :0;

where Pauls says "While we would need all three functions to execute,
the parser
only executes until one of the functions returns false..."

This is normally called "Short Circuiting Logic."

Finally, in Paul's  bitwise usage where he says:

"So instead of using the semicolon to seperate statements, I came up
with
a syntax that uses the '|' operator (you can also use '&')."

 I am curious to refreshing my mind if the JS intepreter short
circuits & bit masking. In other words:

             fn(a) & fn(b)

I have to check that out. I guess it depends on the compiler or
intepreter.

--
HLS

On Aug 20, 9:29 am, Rey Bango <[EMAIL PROTECTED]> wrote:
> jQuery team member and jQuery UI team lead Paul Bakaus got some great
> press from Ajaxian for his blog posting "Advanced ternary conditions in
> JavaScript". Check it out:
>
> http://ajaxian.com/archives/fun-with-ternary-operators
>
> Direct link to Paul's posting:
>
> http://paulbakaus.com/2007/08/17/advanced-ternary-conditions-in-javas...

Reply via email to