

do while - This loop is the same as the while loop but with a single forced loop at the start.while - This loop iterates through a section of code while a condition is true.for of - This loop iterates through the values of an iteratable object.for in - This loop iterates through the properties of an object.for - This loop iterates through a section of code a set number of times.Javascript provides us with five different kinds of loops: Iteration control allows us to set up that process in code, then repeat it by looping through all the users on the list, sending them each an email. We would need a way to automate the process. However, there could be tens of thousands of users in that list. Normally, we would enter a user’s email address, copy-paste a predefined message, and then send the email. Javascript allows us to control the flow of our application even further by looping through sections of code.Īs an example, let’s consider a database of users that are subscribed to a mailing list. In this Javascript tutorial we learn how to loop sections of code with the for, while and do while loops to control the flow of our applications. Loops Javascript Loops (Iteration Control) Tutorial
