deno/cli/tests/top_level_for_await.ts
Yusuke Tanaka 9029003046
build: update dlint to v0.2.10 (#8284)
Update prebuilt "dlint" binary to v0.2.10 and fix diagnostics
for "require-await" rule.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-11-14 20:27:37 +01:00

11 lines
185 B
TypeScript

async function* asyncGenerator(): AsyncIterableIterator<number> {
let i = 0;
while (i < 3) {
yield i++;
}
}
for await (const num of asyncGenerator()) {
console.log(num);
}