Arrays and objects 11.2


#1

I've got a problem here: In console.log it shows the right third position(index number2). But the exercise is not being evaluated.
What might be the solution, here?!

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

Thank You!


#2

the codecademy console has the behavior to log te last value to the console for you (which has it advantages) but in this exercise you need to use console.log() to log the third item to the console, the exercise is counting on it


#3

But we are asked to use the [] notation, the hint says that, too. Besides, it's the shortest form.
And it is shown on the screen on the right!!
So:

languages[2]; // "Javascript" index 2, number 3//

Please


#4

the third element of the array is number 2 (javascript)
cause its begin from zero
and you can access to the third element in the array with console,log by typing like that
console.log (languages[2]);
so your code must be like that
var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];
console.log(languages[2]);


#5

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