⏪ Вернуться в оглавление

About the author


Author: https://t.me/ahillary

Resources


Channel: https://t.me/semolina_code_python

Chat: https://t.me/python_with_ahillary

YouTube: https://www.youtube.com/@semolinacode

Coding training: https://t.me/how_to_code_web3

Prop trading: https://t.me/semolina_prop


Содержание

Async/await

Async/await

Существует специальный синтаксис для работы с промисами, который называется «async/await». Он удивительно прост для понимания и использования.

Асинхронные функции (async)

Начнём с ключевого слова async. Оно ставится перед функцией:

async function f(): Promise<number> {
  return 1;
}