For Loop

If you want to run same code over and over again each time with different value, For loop can be used.

Code Structure
var cities = ["London", "Reading", "Manchester", "Liverpool"];
for(var i = 0; i < cities.length; i++){
 document.write(cities[i] + "<br>");
}

Share this

Related Posts