I think there must be a question like this before but current search engines cannot give you results to queries of code lines.
My question is:
What's the difference between
for ( var i = 0; i < array.length; i ++ )
console.log(array[i]);
and
for ( var e in array )
console.log(e);
In my case, the first returns 'undefined' or sequence of number, while the second works fine.