Promise resolve example

(async () => {
  const promises = [];
  promises.push(new Promise((resolve) => {
    resolve(1);
  }));
  promises.push(new Promise((resolve) => {
    resolve(2);
  }));
  const results = await Promise.all(promises);
  console.log(results);
})();
23 сентября 2021, 13:44