I am attempting to retrieve the value from a setTimeout function, but I am not seeing any output in the console. How do I properly handle asynchronous functions like this? Can someone explain the correct approach to me?
This is what I have tried:
async function getTheme() {
const value = 'abc'
setTimeout(() => {
return value;
}, 3000);
}
getTheme().then(result => console.log(result)); //not receiving any output.