Iterating over an array


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

for (var i = 0; i < languages.length; i++) {
// console.log the 'i'th element
// of the languages array

This is my code, what I don't understand is why it is telling me HTML is not being logged when the index starts from 0 that is logged to the console. Does it mean the word HTML is not being logged?

So confusing codeacademy.

I am starting from 0


Hi your console.log should be like that console.log(languages[i])


Hello wizmarco, thank you again, tell me how much Javascript experience do you have?

So far I have about 30 days experience and I wish there was a way to learn faster.

I have taken out textbooks, been given books to read, watched videos etc.

Any resources you would recommend?



Hi I've finished JavaScript for a while now....but I'm leaning other cours... I think you yet got any resouces I would recomend you.


In my experience, one learns the fastest by trying things out and learning from you mistakes. If you don\t have any "code" background (like me) JS is a great place to start.
I warmly recommend also:


thank you at Puristaja, I will check out the link. Thank you for the resource! smile:

How long have you been coding for?


For over a year now. It gets easier :slightly_smiling:


here is another way to do it

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


That may be a way to do it but you're just console.logging the answers anyway

The exercise wants you to write a for loop to do it,
from what you wrote the only thing thats actually good is the for loop

then why not use console.log(languages[i])
meaning you only have to write 2 lines rather than writing 6 more.


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

for(var i = 0; i < languages.length; i++) {