4. iterating over an array


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

i am getting the output but it says that "you dint log html to the console"
cant figure it out..


I want to believe that there are test scripts behind every exercise. You should remove all the strings before languages[i] so that it sees HTML first.


You might want to make sure this text string matches the one from the instructions.


I had the same issues. It's actually logging "I know HTML" right at the top, but its telling me it didn't log HTML?

Here's my code:

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


found the fix, they don't want you to put anything before the items in the array. Get rid of "I know" in the statement and it works.


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