Example 1 — Quick demo
Core AsyncFunction idea.
JavaScript
async function f() { return 7; }
console.log(f.constructor.name);
f().then(console.log);How It Works
- async function. Returns a promise.
- constructor.name. AsyncFunction.
AsyncFunction is the constructor of async functions. Everyday code should use async function / async arrows instead of new AsyncFunction.
| Topic | Summary |
|---|---|
basics | core AsyncFunction usage. |
async function f() { return 7; }
console.log(f.constructor.name);
f().then(console.log);Core AsyncFunction idea.
async function f() { return 7; }
console.log(f.constructor.name);
f().then(console.log);CODETOFUN NEWS
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
6 people found this page helpful