Can someone please tell me what's wrong with my code


#1

Can someone please tell me what's wrong with my code

var names = ["Victoria", "Paula", "Isaac", "Lucy", "Paul"];

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


Replace this line with your code.


#2

@mjeeezyy

Have a close look at

name


#3

i changed "names" to "name" and it still says

"Your code should have printed 'I know someone called Victoria', but didn't. Make sure to type the 'I know someone called ' part exactly right, and don't forget the space between that phrase and the name!"


#4

Try to change console.log spacing.
What I mean is do this:

console.log("I know someone called" + " " + names[i]);

#5

Still doesn't work unfortunately, it still says....

"Your code should have printed 'I know someone called Victoria', but didn't. Make sure to type the 'I know someone called ' part exactly right, and don't forget the space between that phrase and the name!"

...when i click on "Save & Submit Code"


#6

Dont worry I've fixed it


#7

Dont worry, I've fixed it


#8

@mjeeezyy,
Could you share with us, what the solution was.....


#9

yeah I will....

var names = ["Victoria", "Paula", "Isaac", "Lucy", "Paul"];

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

my variable is "names" then on the 2nd line I didn't write "names.length" instead I wrote "name.length" so when i changed line 2 then the code worked


#10