javascript for-in loop in an Array

satya_love

New Member
If the code is this:\[code\]arr=Array("a","b","c");for(i in arr);{ alert(i);}\[/code\]there is no any alert,but if it is this:\[code\]arr=new Array("a","b","c");for(i in arr){ alert(i);//alerts 0,1,2}\[/code\]What is the reason?
 
Back
Top