Consider these functions:
function waitASecA() {
const promise = new Promise(resolve => setTimeout(resolve, 1000));
return promise; // <--- don't await, just return
}
async function waitASecB() {
const promise = new Promise(resolve => setTimeout(resolve, 1000));
return await promise; // <--- first await, then return
}
As I understand they should be EXACTLY the same. Are there any scenarios when they'd differ in behavior?