Arrays and Object 4 For Loop


Arrays and Object exercise 4

I get the correct output for the for loop code below, but I still get an error message.

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

I get the error message:

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

I cannot figure out why. Is there something that I am missing from my code?

Replace this line with your code.


Your main code is fine, your console.log though seems off. You can just console.log(languages[i]); but if your wanting to use your sentence I can look at that as well. It might be that instead of putting +languages[i] + in quotes you should put languages[i] in ( ) and get rid of the quotes around the plus signs and your languages[i].


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