function makeRequest(arg) { return new Promise(res => { setTimeout(() => res(arg), 2000); }); } const person = { name() { return makeRequest("Mikita"); }, age() { return makeRequest(25); }, city() { return makeRequest("Hrodna"); } }; person[Symbol.iterator] = function() { let index = -1; const propsArr = Object.getOwnPropertyNames(this); return { async next() { index++; if (propsArr[index]) { const answer = await person[propsArr[index]](); return { done: false, value: answer }; } else { return { done: true, value: null }; } } }; }; (async function() { for await (const item of person) { console.log(item); } })();