Promise map and get current value of array <p>Below I have a regular promise bluebird map. What I'd like to achieve is a way to access the current value of the <code>arr</code>, to say that another way, I'd like to access <code>arr</code> from within the map with all of the preceding returned values. Because of this functionality I would also want the whole array to run linearly and in series (<code>{concurrency: 1}</code>).</p> <p>Is this a special kind of map? Does bluebird offer this natively?</p> <pre><code>var Promise = require('bluebird') var arr = ['alpha', 'beta', 'gamma'] Promise.map(arr, function (item) { console.log([item, arr]) return Promise.resolve(['x', item].join('+')) }, {concurrency: 1}) // logs: // [ 'alpha', [ 'alpha', 'beta', 'gamma' ] ] // [ 'beta', [ 'alpha', 'beta', 'gamma' ] ] // [ 'gamma', [ 'alpha', 'beta', 'gamma' ] ] // expected / desired: // [ 'alpha', [ 'alpha', 'beta', 'gamma' ] ] // [ 'beta', [ 'x+alpha', 'beta', 'gamma' ] ] // [ 'gamma', [ 'x+alpha', 'x+beta', 'gamma' ] ] </code></pre>