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


#1


Link to lesson:
https://www.codecademy.com/en/courses/learn-javascript/lessons/loops/exercises/manual-loop

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


#2

here

console.log (vacationSpots[0]);

remove the space before (


#3

Thank you!

What a shame I finished the old Javascript course and didn't even know this...


#4

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


#5

can you please post that code?


#6

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