TypeScriptSyntax
Typed Async Function
Code example
async function load(): Promise<User[]> { ... }Types the result of an async function.
In TypeScript, typed async function: types the result of an async function — async function load(): Promise<User[]> { ... }
async function load(): Promise<User[]> { ... }async function load(): Promise<User[]> { ... }Types the result of an async function.
Use async function load(): Promise<User[]> { ... }.
Use this pattern: async function load(): Promise<User[]> { ... }
Yes. Use Copy code and adapt the example to your program.
No. The language syntax is the same across operating systems.