Codecademy — JS ‘for’ loops

Today I wrote my first for loop in Javascript on Codecademy. I can’t say that I totally understand the “start” and “stop” conditions from above, but I can already tell that these are going to be really useful in the future.

Code:

var vacationSpots = ["Ireland", "Northern Ireland", "Scotland", "Germany", "Australia", "New Zealand", "The United States"]
for (var i = 0; i < vacationSpots.length; i++) {
console.log("I would love to visit " + vacationSpots[i] + ".");
}
Show your support

Clapping shows how much you appreciated Sean McPherson’s story.