lib/vow.js
function(iterable) {
        var defer = new Deferred(),
            isPromisesArray = isArray(iterable),
            keys = isPromisesArray?
                getArrayKeys(iterable) :
                getObjectKeys(iterable),
            i = keys.length,
            res = isPromisesArray? [] : {};

        if(!i) {
            defer.resolve(res);
            return defer.promise();
        }

        var onResolved = function() {
                --i || defer.resolve(iterable);
            };

        vow._forEach(
            iterable,
            onResolved,
            onResolved,
            defer.notify,
            defer,
            keys);

        return defer.promise();
    }
function(iterable) {
        var defer = new Deferred(),
            isPromisesArray = isArray(iterable),
            keys = isPromisesArray?
                getArrayKeys(iterable) :
                getObjectKeys(iterable),
            i = keys.length,
            res = isPromisesArray? [] : {};

        if(!i) {
            defer.resolve(res);
            return defer.promise();
        }

        var onResolved = function() {
                --i || defer.resolve(iterable);
            };

        vow._forEach(
            iterable,
            onResolved,
            onResolved,
            defer.notify,
            defer,
            keys);

        return defer.promise();
    }
function ( iterable ) { var defer = new Deferred ( ) , isPromisesArray = isArray ( iterable ) , keys = isPromisesArray ? getArrayKeys ( iterable ) : getObjectKeys ( iterable ) , i = keys . length , res = isPromisesArray ? [ ] : { } ; if ( ! i ) { defer . resolve ( res ) ; return defer . promise ( ) ; } var onResolved = function ( ) { -- i || defer . resolve ( iterable ) ; } ; vow . _forEach ( iterable , onResolved , onResolved , defer . notify , defer , keys ) ; return defer . promise ( ) ; }
Returns a promise, that will be fulfilled only after all the items in `iterable` are resolved.

@param {Array|Object} iterable
@returns {vow:Promise}

@example
```js
var defer1 = vow.defer(),
defer2 = vow.defer();

vow.allResolved([defer1.promise(), defer2.promise()]).spread(function(promise1, promise2) {
promise1.isRejected(); // returns true
promise1.valueOf(); // returns "'error'"
promise2.isFulfilled(); // returns true
promise2.valueOf(); // returns "'ok'"
});

defer1.reject('error');
defer2.resolve('ok');
```
Returns a promise that will be fulfilled only after all the items in iterable are resolved .