Await / async on anonymous function

You are not calling a function in the second case:

let x = await hello();

This is how you are accessing it in the first case but in the second case, you are just you are adding await to a function declaration. It is just returning function, you need to change it to

let x = await (async function() {return "hello"})();
console.log(x);

You await Promises, which are returned from async functions, not the async function itself. Just add a call:

let x = await (async function() {return "hello"})();
console.log(x);
// or
console.log(await (async() => 'hello')())