Open this lesson on a wider screen to play it. The narrated transcript and animated code need room to sit side by side.
← All lessons// Plain TypeScript: async/await sequences steps, reading straight down.
const fetchUser = () => Promise.resolve({ name: "Ada" });
const greet = (name: string) => Promise.resolve(`Hello, ${name}`);
async function main() {
const user = await fetchUser();
const msg = await greet(user.name);
return `${msg}!`;
}
main().then((line) => console.log(line)); // Hello, Ada!