Answer the question
In order to leave comments, you need to log in
Why doesn't it wait for the first function to execute?
Why is the second console.log executed first. If we have awiat hanging on the first console.log('one')?
module.exports = app => {
app.post('/api/emailVerified', async (req, res) => {
const { uid } = req.body;
try {
await setTimeout(async () => {
return console.log('One');
}, 2000);
console.log('two');
} catch(e){
console.log(e);
}
});
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question