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

1235Re: [jslint] Re: && as flow control

Expand Messages
  • Michael Mikowski
    Mar 17, 2010
    • 0 Attachment
      Type coercion certainly seemed on-topic, as the comment for the following line is wrong precisely because of it:


      > foo[0] && 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@...>
      To: jslint_com@yahoogroups.com
      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.

      Dave

      --- 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[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...
      >




      [Non-text portions of this message have been removed]
    • Show all 12 messages in this topic