Why we say the for-in statement is a "bad practice" is because it can be misused, for example, to iterate over arrays or array-like objects.
So, the main purpose of the for-in statement is to enumerate over object properties. This statement will go up in the prototype chain, also enumerating over inherited properties, a thing that sometimes is not desired.