Access by offset


#1

"Log the third element of the languages array to the console. Make sure to do this by accessing the third element's index."

So i write this

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

It logs the third element, but i get this error

Oops, try again. Make sure you log the third element of the languages array to the console.


#2

HI put this

languages[2]

inside the console.log()


#3

like this?

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

i get
Oops, try again. Your code doesn't look quite right. See the error message for more details: TypeError: console.log is not a function

i tried also

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

and still get
Oops, try again. Make sure you log the third element of the languages array to the console.

just want to also mention, that it does log the third element to the console, i'm just getting this error preventing me from progressing


#4

Now you should put the console.log() like that

console.log(languages[2])

then refresh the page.. And save and submit the code


#5

Ok that's worked, is this some sort of bug?

Thanks for the help


#6

No it' s not a bug ..It's when you do this

console.log = (languages[2])

the you will get the error TypeError: console.log is not a function


#7

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