Access by Offset [SOLVED]


#1



Stage 2

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

"Oops, try again. Make sure you log the third element of the languages array to the console."
Which is exactly what it is doing. I've also tried adding parentheses so it comes out as

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

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

So I'm not sure what I'm doing wrong, because it's printing to the console.
I've also tried the one where you set a new variable to the third element of the array, and then log that variable, but to no avail.


#2

Hi the console.log() work like taht

console.log("Hello")

#Not
console.log = "Hello"

#3

console.log is a function log something to the console:

console.log("i am logged to the console");

Hope this helps, you don't use it as variable name to assign a value too


#4

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

I put it inside parentheses like you both said, and I got back:
"Oops, try again. Your code doesn't look quite right. See the error message for more details: TypeError: console.log is not a function"

So that doesn't work.


#5

Now try to refresh the page..


#6

Oops, I didn't think of that.
Sorry about that! Thanks a ton.