Help me with 12. loops and arrays II


#1

var names ["Matthew","tyler","chelsey","dalton","noah"];

for(i = 0; i < names.length; i ++) {
    console.log("I know someone called " + names[i]);
}

i've refreshed my page and browsed the forums and this looks right it keeps saying: error unexpected token [


#2

It looks like you have to set the var names = to the array :slight_smile:

var names =  ["Matthew","tyler","chelsey","dalton","noah"];

#3

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