I noticed that in Javascript a variable used as the index in a for..in
loop will be always a string
even if I define it the following way:
var s_array = new Array();
s_array[0] = 'foo';
s_array[1] = 'bar';
for(i in s_array){
alert(typeof(i)); // String
}
Why is it considered a string
and not a number
?