I’m not privy to the JavaScript language design discussions, but I assume it’s for the same reasons that the C# language requires async
(also see my blog).
Namely:
- Backwards compatibility. If
await
was suddenly a new keyword everywhere, then any existing code usingawait
as a variable name would break. Sinceawait
is a contextual keyword (activated byasync
), only code that intends to useawait
as a keyword will haveawait
be a keyword. - Easier to parse.
async
makes asynchronous code easier to parse for transpilers, browsers, tools, and humans.