function exc(){
return new Promise(function(resolve, reject) {
setTimeout(async()=>{
let a = 111111
resolve(a);
},1000);
})
}
async function test(){
var a = await exc();
console.log(a)
}
test()
Promise.all(paths.map(path => pathToBase64(path)))
.then(res => {
console.log(res)
})
.catch(error => {
console.error(error)
})
paths.reduce((promise, path) =>
promise.then(res => pathToBase64(path).then(base64 => (res.push(base64), res))), Promise.resolve([]))
.then(res => {
console.log(res)
})
.catch(error => {
console.error(error)
})