I want to call a callback function in the scan function after for await loop ends. How can i do that?
let personObj = {};
let personArray = [];
async function scan() {
for await (const person of mapper.scan({valueConstructor: Person})) {
decrypt(person.name, function () {
personArray.push(personObj);
});
}
}
Forexample i would like to call console.log(personArray)
after the loop.