I have a question. I am currently learning how to use promises but I have run into a problem that I haven't found the answer for after extensive searching. I am trying using map to get an array of promises that are the result of a then block to process in a Promise.all, yet the following does not work, what is going wrong here?
let promises = myArray.map(result =>
{
searchPromise(result.type).then((searchReply) =>
{
return processReply(result, searchReply)
});
}
);
Promise.all(promises).then(c => console.log(c)); //array of Undefined, but
//want to get results from
//processReply function