Hi, I’m new to javascript and I have this two loops in arrays (I got them from codecademy btw).
const vacationSpots = [‘Bali’, ‘Paris’, ‘Tulum’];
for (let i = 0; i < vacationSpots.length; i++){
console.log(‘I would love to visit’, vacationSpots[i]);
}
for (let i = 0; i < vacationSpots.length; i++){
console.log('I would love to visit ’ + vacationSpots[i]);
}
Both of them apparently print the same, but I notice that using the + operator I have to add a space in order to print it properly, with the comma I don’t have to though. I wonder if there’s any reason I should use the one instead of the other.