In JS in can write a self invoking arrow function with async like this:
(async () => {
const promis = fetch(uri);
console.log(await promis);
})();
A self invoking function without parameters I could also write like this:
{
// do something
}
I was asking myself, is there a syntax to combine both and do something like this or is the first example already the shortest form?
// this is not working
async {
const promis = fetch(uri);
console.log(await promis);
}
asyncattributes a function, so the initial syntax is as terse as it can get.