Glossary

Async function

A function that returns a Promise. The await keyword is only usable in an async function.

const wait = (ms) => new Promise((res) => setTimeout(res, ms));
const fn = async () => {
  await wait(100);
  return "result";
}
fn(); // Promise

Synchronous function

A function that returns a value when it's run. See Async function.