Skip to content

Commit edb82d0

Browse files
authored
Add missing example output (#1984)
Reduce items to evade excessive output.
1 parent aa30934 commit edb82d0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lang-guide/chapters/types/basic_types/closure.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,15 @@ Closures are used in Nu extensively as parameters to iteration style commands li
8585
1. You can also use [pipeline input as `$in`](pipelines.html#pipeline-input-and-the-special-in-variable) in most closures instead of providing an explicit parameter. For example:
8686

8787
```nu
88-
1..10 | each { print $in }
88+
1..5 | each { print $in }
89+
# => 1
90+
# => 2
91+
# => 3
92+
# => 4
93+
# => 5
94+
# => ╭────────────╮
95+
# => │ empty list │
96+
# => ╰────────────╯
8997
```
9098

9199
1. You can also pass closures themselves into a pipeline assuming the next command knows how to consume it. For example, the `do` example can be rewritten as:

0 commit comments

Comments
 (0)