Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions live-examples/js-examples/statement/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@
"title": "JavaScript Demo: Statement - For",
"type": "js"
},
"statementForAwaitOf": {
"exampleCode": "./live-examples/js-examples/statement/statement-forawaitof.html",
"fileName": "statement-forawaitof.html",
"title": "JavaScript Demo: Statement - For Await...Of",
"type": "js"
},
"statementForIn": {
"exampleCode": "./live-examples/js-examples/statement/statement-forin.html",
"fileName": "statement-forin.html",
Expand Down
16 changes: 16 additions & 0 deletions live-examples/js-examples/statement/statement-forawaitof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<pre>
<code id="static-js">async function* foo(){
yield 1;
yield 2;
}

(async function () {
for await (const num of foo()) {
console.log(num);
// expected output: 1

break; // closes iterator, triggers return
}
})();
</code>
</pre>