Loading ...
Sorry, an error occurred while loading the content.

1233Re: && as flow control

Expand Messages
  • Dave
    Mar 17, 2010
    • 0 Attachment
      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@yahoogroups.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[0] && fop = foo.shift(); //assigns the first element of foo to fop, if it exists.
      > Conversely, an || statement can be used for alternate functionality.
      > JavaScript also allows this, but jslint does not. I'm curious as to why.
      > Dave
      > P.S., this may have been answered asked before, but it seems that the search functionality of YAHOO! Groups scrubs the '&' character...
    • Show all 12 messages in this topic