douglascrockford/JSLint — Issue #78: Filtering the body of a "for in" loop
Author: wilkinson
Created: 2011-10-16 05:12:31+00:00
State: open

The version of JSLINT on jslint.com (Edition 2011-10-13) incorrectly advises to wrap the body of a "for in" loop inside an "if" statement for the trivial test program that follows.

```javascript
(function () {
'use strict';
var key, n, obj;
n = 0;
obj = {js: 'lint'};
for (key in obj) {
if (obj.hasOwnProperty(key) === true) {
n += 1;
}
}
return n;
}());
```