1 2 3 4 5 6 7 8 9 10 11 12 13
// Check that we can use the async keyword. async function main(): Promise<void> { await new Promise( (resolve): void => { console.log("2"); setTimeout(resolve, 100); } ); console.log("3"); } console.log("1"); main();