Message from JavaScript discussions

April 2019

— It seems I will need it in my game but I don't even know how to form a question about it 😅

— 

Basically there are information that user has to input and the game should wait for them so this sounds like the place to use async and wait, no?

— TRGWII could you show me with console.logs how does async and await work?

— Lol. But NW.js is more matured

— Yep

— Async and await, callbacks, or promises?

— Or all?

— Async and await

— Anybody knows something about this?

— Refer to javascript.info and Mozilla

— async function foo() {
console.log(3);
await something();
console.log(4);
}

console.log(1);
foo().then(function () {
console.log(5);
});
console.log(2);

Message permanent page

— So the only difference would be the content after .then