Loops are used anytime you want to execute a repeated series of actions, usually as an iterative process: looping through every element in an array, for example.
JavaScript offers several different kinds of loop structures, depending on the task at hand. Most coders start with a basic for
loop, which is why it is placed first in this reading list; more advanced loop structures follow, with others (such as forEach
) to come shortly.
Prerequisites: The JavaScript reading list to this point
Time: 1 hour
Photograph by Faruk Ateş, used under a Creative Commons Attribution-NonCommercial 2.0 Generic license.
Enjoy this piece? I invite you to follow me at twitter.com/dudleystorey to learn more.