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

Re: Functions and loops

Expand Messages
  • Douglas Crockford
    ... The common failure case was shown in the example, attaching event handlers in a loop. If the event handlers are bound to variables that are mutated by the
    Message 1 of 3 , May 11, 2008
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "Alan Green" <alan.green.mail@...>
      wrote:
      >
      > Hi
      > Although this is really a javascript (not jslint) issue, could you
      > explain why one should make the function valus in a closure.
      > Thanks
      > Alan

      The common failure case was shown in the example, attaching event
      handlers in a loop. If the event handlers are bound to variables that
      are mutated by the loop, then they are likely to work incorrectly.
    Your message has been successfully submitted and would be delivered to recipients shortly.