Table of Contents

Loops

  • The amount of code inside a loop should be kept as small as possible. Code that is not needed in a loop should be moved out of the loop.

  • Avoid calling properties inside a loop.

  • Break out of the loop as soon as possible (using the break keyword).

  • Go to the next iteration as soon as possible (using the continue keyword).