Closed UnKnoWn-Consortium closed 1 year ago
Similar to #288 and more so to the vanila Array.prototype.reduce, the index number for an array item is added as one of the async callback function parameters.
Array.prototype.reduce
E.g.:
const users = await reduce(userIds, async (acc, userId, index) => { const user = await api.users.find(userId) return { ...acc, [userId]: user } }, {})
Similar to #288 and more so to the vanila
Array.prototype.reduce
, the index number for an array item is added as one of the async callback function parameters.E.g.: