Is this a glitch?


#1



i am currently on lesson 2 "Access by offset". when i try to submit my code it says "Oops, try again. Make sure you log the third element of the languages array to the console." it is logging "JavaScript" into the console. what is it supposed to do? is this a glitch?

here is my code:

var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];{
    languages[2];
};


#2

HI try to remove the {} like that

var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];
languages[2];

#3

ok i did that, but it still says "Oops, try again. Make sure you log the third element of the languages array to the console."
here is the code:

var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];
languages[2];

#4

Ok now just put the languages[2] in a console.log()

And

var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];{
    console.log(languages[2]);
};

#5

Hey @jallu2.0, to LOG something, you have to use, as you can guess, console.log();

So the code would be like following

var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];
console.log(languages[2]);

Hope that will help you :slight_smile:


#6

oh i see thank you! :smiley: