Arrays and Objects in JS- Array Properties


#1

I'm having a problem with the lesson "Array Properties" in Arrays and Objects in JS. It tells us to log the number of elements in languages under my existing code. Looking at the hint, it tells me to write:
console.log(languages.length);
but it is not working for me.

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

Thank you.


#2

Hi this line

console.log = languages[2];

remove the = then refresh the page.


#3

I'm sorry but this didn't work for me.


#4

can you post your new code?


#5

You mean the one after I do what you said?

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


#6

that line

console.log languages[2];

should be like that

console.log(languages[2]);

#7

Great that worked! Thank you.


#8

Hi .. sorry it didn't work for me :confused: it gives an error
((Oops, try again. Your code doesn't look quite right. See the error message for more details: TypeError: console.log is not a function))

my code is:

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


#9

Hi try to refresh the page..