This could be more cleanly written as

```javascript
if (arguments[i].hasOwnProperty(attr) && typeof result[attr] === "undefined")
```