This seems to work fine:

var a = true;
function foo() {return a;}
function foobar() { return foo() || false;}

...and as for personal opinion, I would be proud to write such code. Compact, 
graceful, elegant.
Whether or not it's "readable" is strictly a matter of one's opinion--opinion 
driven by what
you've been exposed to in your life (i.e., your experiences). For instance, my 
opinion is that
braces are ugly and waste valuable screen real estate, but clearly others have 
different opinions.
Each of us have different life experiences which contribute to our definition 
of "readability."



--- Nickolay Ponomarev <[EMAIL PROTECTED]> wrote:

> Paul Tomlin wrote:
> >> We could argue about it, but that doesn't lead anywhere. However,
> >> the question he asked still interests me, and I don't know the answer:
> >>
> >> Is the construct shown above correct, and officially supported in
> >> javascript, or is it not?
> > 
> > Indeed. I'm tempted to look at the ECMA spec, though it always gives me 
> > headaches and never guarantees that it's implemented.
> 
> I'll save you some headaches.
> 
>  > (function f() { var a = false || return 1 })()
> SyntaxError: syntax error
> 
> Nickolay
> _______________________________________________
> Project_owners mailing list
> [email protected]
> http://mozdev.org/mailman/listinfo/project_owners
> 

_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners

Reply via email to