You can use following code instead
```javascript
result = result && obj.attr(name) == value
```