async function getGreeting() { return 'Hello from an async function'; } getGreeting().then((message) => console.log(message)); // Logs: Hello from an async function
Click Run to execute this code.