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

Re: [jslint] Re: var a = var b = foo();

Expand Messages
  • Daniel Cassidy
    ... Uhh... sorry. It is of course a syntax error. Chalk that one up to temporary insanity on my part. I was thinking of another language where var b is an
    Message 1 of 4 , Dec 16, 2008
    • 0 Attachment
      2008/12/16 Douglas Crockford <douglas@...>:
      > --- In jslint_com@yahoogroups.com, "Daniel Cassidy" <mail@...> wrote:
      >> JSLint forbids the following form:
      >>
      >> var a = var b = foo(); // Expected an identifier and instead saw 'var'.
      >>
      >> Is this intentional?
      >
      > Of course.

      Uhh... sorry. It is of course a syntax error.

      Chalk that one up to temporary insanity on my part. I was thinking of
      another language where "var b" is an expression, and so returns a
      value (as well as declaring a variable).

      Dan.
    Your message has been successfully submitted and would be delivered to recipients shortly.