Introduction to 'For' Loops in JS - Loops and Arrays II


#1

// Click on "Stuck? Get a hint!" if you get stuck!

var names ["Mike", "Nick", "Carmine", "Sohee", "Chris"]; 
for (var i = 0; i < names.length; i++) {
    console.log("I know someone called " + names[i];
    }

Can anyone tell me what I am doing wrong? I've been stuck on this for a while and can't figure what I am missing??? Thanks in advance!

-Mike


#2

You forgot the "=" defining the Array.
var names = ["Mike", "Nick", "Carmine", "Sohee", "Chris];


#3

:grinning: :gun: Thank you so much!!


#4

You also seem to forgot the closing ) for your console.log.