map
description
Iterates over a collection (Array, Object, Map, Set
) and returns a new collection of the same type containing each value from the input collection after it has been transformed by the provided mapper function.
Like many Collection
methods in Conductor, map
works with both asynchronous & synchronous mappers. If you use a synchronous mapper, map
will work like Array.prototype.map
and return a Collection synchronously.
If you use an asynchronous mapper, map
will return a Promise
, and you will need to use await
or Promise.prototype.then
to retrieve the new collection.
Important
If you use an asynchronous mapper, all mapper
calls will be done in parallel, but the input collection's order will be preserved.
Last updated