I want the hello function to return a Promise. Why does it return undefined?
I think the wait function is confusing me. I tried to explain my understanding of it but could not put it in words.
Could someone please explain this to me in very basic terms.
function wait (ms =0){
return new Promise((resolve)=>{
setTimeout(resolve, ms)
})
}
async function hello(){
const nw = await wait(2000);
console.log(nw);
}
hello();