Loops and Arrays-II


#1


var names = [ "vk","vj","ak","ar","str"];

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

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


Replace this line with your code.


#2

you have two spaces between the phrase and the name, one is enough


#3

i'm also get same error


#4

Make sense? You created the topic, and i provided the solution:


#5

now in use one space... and get same error...

var names = [ "vk","vj","ak","ar","str"];

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


#6

Code works fine now, try refreshing the page/different browser.


#7

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