Nalini1998 / Project_Public

MIT License
2 stars 0 forks source link

Write a for loop that iterates through our vacationSpots array using i as the iterator variable. #545

Closed Nalini1998 closed 1 year ago

Nalini1998 commented 1 year ago

Inside the block of the for loop, use console.log() to log each element in the vacationSpots array after the string 'I would love to visit '. For example, the first round of the loop should print 'I would love to visit Bali' to the console.

Nalini1998 commented 1 year ago

My code for your reference:

const vacationSpots = ['Bali', 'Paris', 'Tulum'];

// Write your code below
for (let i = 0; i < vacationSpots.length; i++) {
  console.log(`I would love to visit ${vacationSpots[i]}`);
}