Possible Duplicate:
  Why avoid increment (&ldquo;++&rdquo;) and decrement (&ldquo;--&rdquo;) operators in JavaScript?  




I'm a big fan of Douglas Crockford and his excellent book, JavaScript: The Good Parts. I also use his JSLint tool on an hourly basis before checking in any code to our repository, as is good sense.

One thing I've noticed when running code through JSLint is its insistence that the ++ increment operator is somehow evil. I know I can turn certain rules off, but that's cheating ;). Crockford mentions his dislike on page 112 of JS: TGP...


  In my own practice, I observed that when I used ++ and --, my code tended to be too tight, too tricky, too cryptic. So, as a matter of discipline, I don't use them any more. I think that as a result, my coding style has become cleaner.


That's all very lovely, but he doesn't give any examples of the way he codes them now. I assume he's doing something like...

var i;
i = 0;
i = i + 1;


Again, great, but I've got a few basic 'for loops' in my JS code, as I imagine many people have, and I've always used the standard syntax...

for (i = 0; i &lt; myArray.length; i++) { 
    // Loop Stuff 
}


Am I missing something? What's the cleanest and/or best way to increment/decrement?


Question: Sinks and Sources
Answer: Just define a function, $f$, that has three zeros, and to ensure these zeros are all sinks of the differential equation, make sure that $\frac{df}{dx} &lt; 0$ at each zero. Note this requires that $f$ is a discontinuous function. As a specific example, with zeros at $-1$, $0$ and $1$,
$$
f(x) = \left\{ \begin{array}{lc}
-x-1 \;, &amp; x \le -\frac{1}{2} \\
-x \;, &amp; -\frac{1}{2} &lt; x \le \frac{1}{2} \\
-x+1 \;, &amp; x &gt; \frac{1}{2}
\end{array} \right. \;.
$$
With instead $-f(x)$, the zeros are sources.