diff options
author | Andy Hayden <andyhayden1@gmail.com> | 2019-10-27 06:04:42 -0700 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-10-27 09:04:42 -0400 |
commit | aec5a646c9218a0a0da62cbcd1f28bc23c242540 (patch) | |
tree | e052f0263eb2abc4915dc3710ec44ee34e9ad621 /std/manual.md | |
parent | 51dd91a3ccfd9554bcf69b539f2f748da81c5b12 (diff) |
feat: top-level-for-await (#3212)
Diffstat (limited to 'std/manual.md')
-rw-r--r-- | std/manual.md | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/std/manual.md b/std/manual.md index 03042c0fd..6da2d0ec2 100644 --- a/std/manual.md +++ b/std/manual.md @@ -937,12 +937,10 @@ Example: import { serve } from "http/server.ts"; -window.onload = async function() { - const body = new TextEncoder().encode("Hello World\n"); - for await (const req of serve(":8000")) { - req.respond({ body }); - } -}; +const body = new TextEncoder().encode("Hello World\n"); +for await (const req of serve(":8000")) { + req.respond({ body }); +} ``` ```shell |