Number 12 introduction to for loops


#1

var names = ["ibrahima", "Mouhamed", "Mustapha","salimata", "Daouda"];
for (var i = 0; i < names.lenght; i ++) {
    console.log("I know someone called " + "" + names[i]);
}

#2

Hi @tijanne,

See here?

for (var i = 0; i < names.lenght; i ++) {

you misspelled, and missed the parentheses in .length(). Do it like this;

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

#3

thanks i solved it yesterday.


#4

Would you mind posting how you solved it, so that other users with this problem can benefit?


#5

Ok, course 12 loops and arrays:

var names = ["Ibrahima", "Mouhamed", "Mustapha","Salimata", "Daouda"];

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

#6