1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

docs(examples): improve cat example (#10498)

This commit is contained in:
vwkd 2021-05-05 06:07:08 +02:00 committed by GitHub
parent 820c658ff8
commit f44a5706e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,8 +21,7 @@ is opened, and printed to stdout (e.g. the console).
/**
* cat.ts
*/
for (let i = 0; i < Deno.args.length; i++) {
const filename = Deno.args[i];
for (const filename of Deno.args) {
const file = await Deno.open(filename);
await Deno.copy(file, Deno.stdout);
file.close();