Skip to content

Commit 0cc6ad7

Browse files
committed
Add for no async iterator
1 parent 6377516 commit 0cc6ad7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/js/asyncIterable.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,12 @@ const alimentosAsync = {
6262
};
6363

6464

65+
66+
67+
68+
6569
(async function () {
66-
const iterator = alimentosAsync[Symbol.iterator]()
67-
console.log((await iterator.next()).value)
68-
console.log((await iterator.next()).value)
69-
console.log((await iterator.next()).value)
70-
console.log((await iterator.next()).value)
70+
for await (const alimento of asyncIteratorAlimentos) {
71+
console.log(await alimento)
72+
}
7173
})()

0 commit comments

Comments
 (0)