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

Re: [jslint] Re: expected a conditional statement and instead saw an assignment

Expand Messages
  • Daniel Cassidy
    ... (granted in this specific case the DOM API guarantees the array will not contain any falsy values, but the same is not true for many other arrays).
    Message 1 of 10 , Jan 15, 2009
    • 0 Attachment
      2009/1/15 Daniel Cassidy <mail@...>:
      > As well as that, the two loops are *not* equivalent. The first loops
      > until it reaches *either* the end of the array or a falsy value (e.g.
      > false, zero, undefined, etc). The second always loops until the end of
      > the array.

      (granted in this specific case the DOM API guarantees the array will
      not contain any falsy values, but the same is not true for many other
      arrays).
    • Philip Hutchison
      ... Wow, that s good to know. I hadn t considered that possibility, and if I had run into a falsy (killing the loop) it could have really screwed something
      Message 2 of 10 , Jan 16, 2009
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "Daniel Cassidy" <mail@...> wrote:
        >
        > 2009/1/15 Daniel Cassidy <mail@...>:
        > > As well as that, the two loops are *not* equivalent. The first loops
        > > until it reaches *either* the end of the array or a falsy value (e.g.
        > > false, zero, undefined, etc). The second always loops until the end of
        > > the array.
        >
        > (granted in this specific case the DOM API guarantees the array will
        > not contain any falsy values, but the same is not true for many other
        > arrays).
        >

        Wow, that's good to know. I hadn't considered that possibility, and
        if I had run into a falsy (killing the loop) it could have really
        screwed something up.

        Thanks for the tip!
      Your message has been successfully submitted and would be delivered to recipients shortly.