Iterating over an array 4/17


This is my code, but it says "Oops, try again. It looks like you didn't log 'HTML' to the console!"

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

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


In your console.log, where did the "i" come from? The problem in that code is that they do not know WHERE.

You have to add where, like this:



lmao, wow how did I forget that one.

Thanks so much for a quick reply!


i got stuck for a moment on this too but managed to figure it out, while i was stuck i kept trying things. i logged in the same code as above but at one point i put
console.log(languages++) and i passed the test. it logged NaN but i knew that wasnt what i was supposed to log. my question is why did it work, if its clearly not what i should have done?


I am stuck on this one... not sure where I've made an error. Can anyone help me debug this code?

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

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



You've spelt languages wrong in your loop.



Not gonna lie... definitely feeling like a idiot right now. lol


Thanks for the help. It help me too!


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

What I did wrong??


Hi try to add a { } at the for loop and remove the ; after the for loop LIke that

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


figured it out already, but thanks for help :slightly_smiling:


This my original code that works! Try It! I did a confusing route but I knew it was unclear and basically wrong but still right. I got my correct solution thanks to you guys though. :slightly_smiling:
var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];
for (var each = 0; each < languages.length; each++) {


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