Answer the question
In order to leave comments, you need to log in
Problem with asycn/await?
Good afternoon.
Tell me what I'm doing wrong:
(async () => {
let testConnection = async () => {
await seq.authenticate();
console.log('Connection ok');
}
await testConnection();
})();
console.log('ttt');
ttt, and then
connection ok? I tried to create my own Promise in it, already call seq.authenticate () and then wrap my Promise in async / await, but I get the same result.
Answer the question
In order to leave comments, you need to log in
Why should it be different in principle?
You did this:
new Promise(function(resolve, reject) {
seq.authenticate().then(function(result) {
console.log("Connection ok");
resolve(result);
});
});
console.log('ttt');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question