How do I get this code to log the array?


#1


what's wrong?


var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];
for (var i = 0; i < languages.length; i++) {
    console.log(i);
};


#2

i is just a number, you can use it as index to get items from the list


#3

can I get an example of that please?


#4

general syntax:

yourArray[indexNumber]

you can also always check documentation of you need a reminder of syntax


#5

okay thanks I'll try to fix that problem


#6

here is my new code and the message I'm getting

var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];
for (var i = 0; i < languages.length; i++) {
console.log(languages.length);
languages[i];
};

Oops, try again. It looks like you didn't log 'HTML' to the console!

how do I get the array to log into the console?


#7

you log the length (languages.length) to the console, you should log the items from the list (languages[i]) to the console


#8

okay I hit the reset code button to try to fix the code.


#9

And I fixed it thanks for the help!


#10