Promises and async Types
Async functions return Promise<T>. await gives T.
Example
async function load(): Promise<number> { return 42; }
async function main() { const n = await load(); console.log(n + 1); }
main();Result
43
Exercise
Return type.
async function f(): <number>
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.