4. Iterating over an array


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-9Sgpi/0/4?curriculum_id=506324b3a7dffd00020bf661#


Unexpected end of input


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

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


#2

how do i fix this :scream:


#3

You need to have brackets to define a code block;


#4

var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];
for (var i = 0; i < languages.length; i++){
    console.log(languages[i]);   <----loop through the languages and index each value
}
language identifies the object[i]<--iterates through the index 0,1,2,4,

#5

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