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

Invalid left-hand side assignment

Expand Messages
  • Chris
    I recent debugged some code that followed this pattern: var a, b, c; a === b = c; When executed, this results in a syntax error, due to invalid left-hand side
    Message 1 of 2 , Nov 3, 2011
    • 0 Attachment
      I recent debugged some code that followed this pattern:

      var a, b, c;
      a === b = c;

      When executed, this results in a syntax error, due to invalid left-hand side assignment. However, this code passes JSLint. I believe JSLint would be improved if it flagged this pattern as a source of error.
    • Douglas Crockford
      ... Thanks. Please try it now.
      Message 2 of 2 , Nov 3, 2011
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "Chris" <Nielsen.Chris@...> wrote:
        > I recent debugged some code that followed this pattern:
        >
        > var a, b, c;
        > a === b = c;
        >
        > When executed, this results in a syntax error, due to invalid left-hand side assignment. However, this code passes JSLint. I believe JSLint would be improved if it flagged this pattern as a source of error.


        Thanks. Please try it now.
      Your message has been successfully submitted and would be delivered to recipients shortly.