*simplified*, the symantics of "await" are just syntactic sugar
const value = await someFunction()
console.log(value);
is syntactic sugar for
return someFunction().then(function(value) {
// this gets executed after the return IF
// something else didn't remove all events like
// loading a new page
console.log(value);
});
*simplified*, the symantics of "await" are just syntactic sugar
is syntactic sugar for