function scaryClown() {
return new Promise(resolve => {
setTimeout(() => {
resolve('a')
}, 1000)
});
}
function msg2() {
const msg2 = async () => {
const result = await scaryClown()
console.log(result)
}
msg2()
}
async function msg() {
const result = await scaryClown()
console.log(result)
}
What is the difference between the two functions msg and msg2?
(msg和msg2这两个函数有什么区别?)
ask by Henok Tesfaye translate from so