Array doesnt work


#1

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


#2

Here the variable languages is of type array(stores an array) awesome

but then you override that here

and you have a spelling error

should be

languages[0]

Now if you donot pass the test then it probably mean that when code academy tests your code for that variable languages they expect an array but then you overrode it to store a string


#3

Yeah it doesnt work but itis right


#4

you just have to correct that error here and the code is right
langauage[0] should be languages[0] because what you wrote langauage is not defined


#5

Here is my new code
var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];
var languages = languages[0];


#6

Perhaps you wanna log that string to console instead of storing it in languages like this

console.log(languages[0]);

#7

@rydan doesnt work when i did that it said
Looks like your code didn't log the third element of the languages array. Remember that array indexes start from 0.


#8

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


#9

@codeace40947 the third element in the array is not at index 0 but rather index 2. thats what you need to be accessing and printing to screen