Question: I have an array of objects

```
var arr = [{a:1},{a:5}, {a:6},{a:11}];

```

I want to use underscore find where function to retrieve object satisfying condition `a = 1` or `a =11`

**like:**

```
_findWhere(arr, {a:1} || {a:11})

```

Anything like this is possible ??

Answer: 
[**find**](http://underscorejs.org/#find) behaves like findWhere in that it returns the first item that passes the search criteria. With find you can use a predicate to specify the search criteria.

```
var result = _.find(arr, function(item) {
    return item.a == 1 || item.a == 11;
});

```
You could write it in plain Javascript with [`Array#some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)

```js
var arr = [{ a: 1 }, { a: 5 }, { a: 6 }, { a: 11 }, { a: 11 }],
    found = function (array) {
        var index;
        return arr.some(function (a, i) {
            if (a.a === 1 || a.a === 11) {
                index = i;
                return true;
            }
        }) && array[index] || undefined;
    }(arr);

document.write('<pre>' + JSON.stringify(found, 0, 4) + '</pre>');
```