The `for...in` in statement allows you to loop through the names of all of the properties of an object. Unfortunately, the list of properties includes all those properties that were inherited through the prototype chain. This has the bad side effect of serving up method functions when the interest is in data properties. Programs that don't take this into account can fail.

Therefore, the body of every `for...in` statement should be wrapped in an `if` statement that filters which properties are acted upon. It can select for a particular type or range of values, or it can exclude functions, or it can exclude properties from the prototype.

## Noncompliant Code Example

    for (name in object) {
        doSomething(name);  // Noncompliant
    }

## Compliant Solution

    for (name in object) {
      if (object.hasOwnProperty(name)) {
        doSomething(name);
      }
    }