Loops and arrays II


#1

Dear team,

Could you please help me, why my code is not work properly:

var names = ["Durko", "Igor", "Sasha", "Oleg", "Leonid"]
for ( var i = 0; i <= 4; i ++) {
console.log('I know someone called ' + names[i] + ".");
}

Mistake:
Oops, try again. Your code should have printed 'I know someone called Durko', 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!

Please help me as soon as someone find a little time for my issue,
I would very appreciate any help,


#2

you shouldn't have a dot at the end of your console.log, correct code:

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

your code:

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