Can someone help me with this?


#1

var names=["ram","tom","uday","idar","queen"];
for (var i=0; i<4; i++);{
console.log( "I know someone called" + " " + names[i]);
}

This is showing error


#2

Try removing the ";" between the conditions of the "for" loop and the brackets. Also, consider how strict inequalities affect your bounds if you intend for all of the names to be included.


#3

in your coding the array string length is more than four so use a number that is more than 4 i.e inside the loop it should be (var i=0; i<5; i++) then remove the semi colon before you print out


#4

var names =["Lora","Angie","Heather","Jannie","Annie"];
for(var a = 0; a < names.length; a++){
console.log("I know someone called " + names[a]);
}
Here this will run.