I'm trying to get the value of an inputed variable on a callback function and assign it into another variable value outside this callback function. I'm using async/await but not working (the assignment runs before the callback function), any suggestion?
async function iniciar() {
let my_prep = '';
await readline.question('Insert preposition', (prep) => {
**my_prep = prep;**
readline.close();
});
console.log('OK',my_prep);
return true;
}
Thanks for reading!

readline.questionreturns a promise?