As the defination says for-in loop is used to loop through the properties of an object ,than why is it looping the element of an array?
var arr = ['a','b','c'], indexes = [];
Array.prototype.each = function() {/*blah*/};
for (var index in arr) {
indexes.push(index);
}
indexes; //["0", "1", "2", "each"]
why are 0,1,2 enumerated?They are not the properties