DEV Community

Cover image for Loop micro-optimization
Raj Maharjan
Raj Maharjan

Posted on

Loop micro-optimization

loop

Because:

  1. For loop uses one less variable
  2. Count down to 0 is usually faster because it's more efficient to compare to 0 than others.

Top comments (0)