Programming Loops

By: Dusty Arlia
Published on October 31, 2012
Last Updated on Sunday, July 12, 2015 at 2:14 PM
Total Updates: 6

A programming loop is a part of your software program that handles repetitive tasks. These tasks can be one step or multiple steps. Loops often work with arrays and will iterate through each element performing some kind of task. Computers handle repetitive tasks well, so using loops is quite common while programming.

Here are the different kinds of loops:

Each type of loop has its own advantages and disadvantages. If you think of your JavaScript program as a path for your JavaScript interpreter to take, you can think of a loop as a path that leads back to an earlier part in your path. You will come across a point in your program where you will need to decide whether to continue moving forward or loop back and do something again based on a condition. This point is called the loop condition.