lib/async.js
function asyncFilter(promise, iterator, scope, limit) {
    return asyncArray(asyncLoop(promise, iterator, scope, limit).chain(function (results) {
        var loopResults = results.loopResults, resultArr = results.arr;
        return (isArray(resultArr) ? resultArr : [resultArr]).filter(function (res, i) {
            return loopResults[i];
        });
    }));
}
function asyncFilter(promise, iterator, scope, limit) {
    return asyncArray(asyncLoop(promise, iterator, scope, limit).chain(function (results) {
        var loopResults = results.loopResults, resultArr = results.arr;
        return (isArray(resultArr) ? resultArr : [resultArr]).filter(function (res, i) {
            return loopResults[i];
        });
    }));
}
function asyncFilter ( promise , iterator , scope , limit ) { return asyncArray ( asyncLoop ( promise , iterator , scope , limit ) . chain ( function ( results ) { var loopResults = results . loopResults , resultArr = results . arr ; return ( isArray ( resultArr ) ? resultArr : [ resultArr ] ) . filter ( function ( res , i ) { return loopResults [ i ] ; } ) ; } ) ) ; }
Loops through the results of an promise resolving with the filtered array.
The promise can return an array or just a single item.

```
function asyncArr(){
var ret = new comb.Promise();
process.nextTick(ret.callback.bind(ret, [1,2,3,4,5]);
return ret.promise;
}

comb.async.filter(asyncArr(), function(item){
return item % 2;
}).then(function(arr){
console.log(arr); //[1,3,5];
});

```

You may also return a promise from the iterator block.

```
comb.async.filter(asyncArr(), function(item, index){
var ret = new comb.Promise();
process.nextTick(function(){
ret.callback(item % 2);
});
return ret.promise();
}).then(function(){
console.log(myNewArr) //[1,3,5];
})
```


@param {comb.Promise|Array} promise the promise or array to loop through
@param {Function} iterator a function to invoke for each item
@param [scope] optional scope to execute the function in.
@return {comb.Promise} a promise that is resolved with the filtered array.
@static
@memberof comb.async
@name filter
Loops through the results of an promise resolving with the filtered array . The promise can return an array or just a single item .