async function asyncCall() {
let promise = new Promise((resolve, reject) => {
setTimeout(() => resolve("готово!"), 1000)
});
for (let i=0; i < 100; i++) {
console.log(await promise);
}
}
function getPromise() {
return new Promise((resolve, reject) => {
setTimeout(() => resolve('готово'), 1000);
});
}
async function asyncCall() {
for (let i=0; i < 100; i++) {
console.log(await getPromise());
}
}