[Learn JS > Loops(2/7)] Error: Did u console.log vacationSpots[0]?

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
Link to lesson:
https://www.codecademy.com/en/courses/learn-javascript/lessons/loops/exercises/manual-loop

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>

Instruction so far:
2. Next, console.log each item in vacationSpots on a separate line. To do this, list out each item using property access.

Error:
Did you console.log vacationSpots[0]?

My code:

var vacationSpots = ['asd', 'asda', 'asdasd'];
console.log (vacationSpots[0]);
console.log (vacationSpots[1]);
console.log (vacationSpots[2]);

Here’s how my code looked it:

I tried to reset it:


But it still has the same error:

Another attemp but still has the error

here

console.log (vacationSpots[0]);

remove the space before (

1 Like

Thank you!

What a shame I finished the old Javascript course and didn’t even know this…

Hi sorry to bother you…

I see thats the problem was with the white space. But as what I’ve mentioned in my original post, I reset the activity and still got the same error. After I reset the activity it showed me another code and it was able to display to the console, but the error is still there.By any chance do you know what could have caused the error in this? Thanks again

can you please post that code?

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