Declare var outside of for and cache the length.

```js
var rules = [],
     i,
     len;
for (i = 0, len = elm.style.rule.length; i < len; i += 1) {
```