im new to javascript and struggling with the concepts, how do i access the return value of the async function outside of it, i have tried a .then method but it only returns undefined... this is my code, i want to assign the result to the contractNumber variable outside of the async function so i can pass it to another function and also console.log the result externally... im coming over from learning python so im super confused
const inquirer = require('inquirer')
async function getContract() {
await inquirer.prompt({
type: 'input',
name: 'retrieveContract',
message: "Enter contract adress: ",
})
.then(answer => {
console.log(`Targetting: ${answer.retrieveContract}`);
results = answer.retrieveContract
return results
});
}
getContract()
contractNumber = results