Ordered promise resolution
const arr = [
new Promise(resolve => { setTimeout(() => { resolve(1)}, 1100)}),
new Promise(resolve => { setTimeout(() => { resolve(2)}, 100)}),
new Promise(resolve => { setTimeout(() => { resolve(3)}, 3000)})
];
arr
.reduce((acc, v) => {
acc.then(accVal => console.log(accVal))
return v;
})
.then(final => console.log(final))