Loading problem…
Implement mapAsync(items, mapper) to map an array with an asynchronous mapping function and return a single Promise for all mapped results.
Unlike Array.prototype.map, the mapper may return a Promise, so your utility must wait for all mappings to finish before resolving.
mapAsync(items, mapper)mapper can return either a value or a Promise.mapper(item, index, items)TypeError if items is not an array.TypeError if mapper is not a function.