1235Re: [jslint] Re: && as flow control
- Mar 17, 2010Type coercion certainly seemed on-topic, as the comment for the following line is wrong precisely because of it:
> foo && fop = foo.shift(); //assigns the first element of foo to fop, if it exists.Sorry it didn't help you Dave.
From: Dave <david.hampton@...>
Sent: Wed, March 17, 2010 3:28:09 PM
Subject: [jslint] Re: && as flow control
Thanks MLorton and SWeiss for the good feedback.
The discussion about type coercion was an off the topic disection of my analogy, not a succinct answer to the '&&' as flow control issue.
So thanks you two for staying on topic.
--- In jslint_com@yahoogro ups.com, "Dave" <david.hampton@ ...> wrote:
> Many languages allow a convenience in scripting that allows an && to be used as flow control.
> var foo = [1,2,3,4];
> foo && fop = foo.shift(); //assigns the first element of foo to fop, if it exists.
> Conversely, an || statement can be used for alternate functionality.
> P.S., this may have been answered asked before, but it seems that the search functionality of YAHOO! Groups scrubs the '&' character...
[Non-text portions of this message have been removed]
- << Previous post in topic Next post in topic >>