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

Re: ++

Expand Messages
  • sandyhead25
    ... This thread implies the increment or decrement operator in the general sense, so I was clearly reading too much into the question. I would say this is
    Message 1 of 5 , Jul 4, 2009
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
      >
      > --- In jslint_com@yahoogroups.com, "sandyhead25" <austin.cheney@> wrote:
      > >
      > > Would you be able to use a brief example of code so that
      > > we could see such an occurrence in the context you are
      > > referencing?
      >
      > --1;
      > f()++;
      > --a--;
      > ++(a + b);
      >

      This thread implies the increment or decrement operator in the general sense, so I was clearly reading too much into the question.

      I would say this is entirely a nonissue. The operators are deemed potentially harmful. If they are not used then problems concerning them can be avoided. There does not exist any code written in JavaScript that cannot be rewritten to avoid use of these operators.

      The previous examples explained without the operators:
      --1 === 1 += 1
      f()++ === f() += 1
      --a-- === (1 -= a) -= 1
      ++(a + b) === (a + b) += 1
    Your message has been successfully submitted and would be delivered to recipients shortly.