Before we jump into writing a loop, let’s write the result of a loop, so that we can better understand how loops work.
Write an array and set it equal to a variable named
vacationSpots. Inside of this array, list three places you’d like to visit.
console.log each item in
vacationSpots on a separate line. To do this, list out each item using property access.
Nice work, that wasn’t too hard, but imagine if our vacation list had 100 places on it. This would be an extremely tedious task!
Let’s make this easier with a