const findNum = async ()=>{
setTimeout(()=>{
return 5;
},1000)};
const getNum = async ()=>{
const num = await findNum();
return num;
}
const number = getNum();
console.log(number);
number.then((result)=>{
console.log(result);
});
I tried so many answers from stack overflow,
like the "then" keyword, but it doesn't work!
The result I got was always like this or just some errors
Promise { <pending> }
undefined
how could I get the result out of the Promise?