title: Why avoid increment ("++") and decrement ("--") operators in JavaScript?
body: <p>One of the <a href="http://www.jslint.com/lint.html" rel="noreferrer">tips for <code>jslint</code> tool</a> is:</p>
  <blockquote>
  <p><strong><code>++</code> and <code>--</code></strong><br />
  The <code>++</code> (increment) and <code>--</code> (decrement)
  operators have been known to contribute to bad code by
  encouraging excessive trickiness. They
  are second only to faulty architecture
  in enabling to viruses and other
  security menaces. There is a plusplus
  option that prohibits the use of these
  operators.</p>
  </blockquote>
  <p>I know that PHP constructs like <code>$foo[$bar++]</code> may easily result in off-by-one errors, but I couldn't figure out a better way to control the loop than a:</p>
  <pre><code>while( a &lt; 10 ) do { /* foo */ a++; }
  </code></pre>
  <p>or</p>
  <pre><code>for (var i=0; i&lt;10; i++) { /* foo */ }
  </code></pre>
  <p>Is the <code>jslint</code> highlighting them because there are some similar languages that lack the &quot;<code>++</code>&quot; and &quot;<code>--</code>&quot; syntax or handle it differently, or are there other rationales for avoiding &quot;<code>++</code>&quot; and &quot;<code>--</code>&quot; that I might be missing?</p>