For Loops II strange error


#1

I just chang var names to var name.
It can run ,but print like:
I know someone called A
I know someone called A
I know someone called ,
I know someone called B
I know someone called B
I know someone called ,
......


var name = ["AA","BB","CC","DD" ,"EE"];
for (var i=0; i < name.length; i++){
console.log("I know someone called" + " "+ name[i]);
}


#2

How would you like your output to look?


#4

So when you had var names it works fine, I guess. Very strange behavior.


#5

like:
I know someone called AA
I know someone called BB
I know someone called CC
I know someone called DD
I know someone called EE


#6

yeah,but when I had var nameit works strange.
I don't know the differences between names and name.


#7

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