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

3182Re: jslint error: "Bad for in variable 'header'.?

Expand Messages
  • douglascrockford
    Mar 19, 2013
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, Lindsay John Lawrence <thinknlive@...> wrote:
      >
      > I am currently getting the following error in JSLint and don't understand why.
      > -----------------------------------------------------------------------
      > Bad for in variable 'header'.
      > -----------------------------------------------------------------------
      >
      > I am iterating over object {} properties (not an array), am using hasOwnPropery() and both header and headers are declared in the relevant scope.
      >
      > Can someone tell me why? I read through the '
      >
      > Sample Code:
      >
      >         var header;
      >         var headers = {...};  
      > for (header in headers) {
      >      if (headers.hasOwnProperty(header)) {
      >          .....
      >      }
      > }


      It works for me.
    • Show all 13 messages in this topic