var arr = [1,2 ,3, 4, 5, 6, 67, 8, 10];
function f1 () {
return arr.map(function (member) {
console.log(member);
return Promise.resolve(member + 2).then((result) => {return result + 2}).then
(value => {return value + 1});
});
}
console.log(f1());
The output is an array of Promise { <pending> }
at every single index. What is the issue? I thought the return value + 1
at the end resolved the promises, so why am I getting pending?