3.For loops error

Hi Guys,

I pushed this code, for ‘for loops’ in the javascript exercise. It isn’t wrong, i have requested the right code, it was the same I had, but the error message keeps playing.

This is it

var vacationSpots = [‘Paris’, ‘New York’, ‘Barcelona’];

for (var i = 0; i < vacationSpots.length; i++) {
console.log('I would love to visit ’ + vacationSpots[i]);

Can anyone tell what’s wrong with this?


1 Like

What error message are you receiving? Can we have a link to the lesson so we can see the instructions and test the code, please? Thanks.

1 Like

I have the same problem as well. Here’s the link to the lesson any help would be appreciated.

1 Like

I ran your code and it was accepted, and output,

I would love to visit Paris
I would love to visit New York
I would love to visit Barcelona
1 Like

hello the problem is in the console.log you need to put this code there
its a small change but for me it workt.

replace this:
console.log('I would love to visit ’ + vacationSpots[i]);
with this:

happy coding.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.