Skip to content

Commit

Permalink
Docs should update for first/1 etc. not /0
Browse files Browse the repository at this point in the history
  • Loading branch information
mousetail authored Sep 14, 2024
1 parent 7896db5 commit bb8687a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/content/manual/v1.7/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3004,10 +3004,16 @@ sections:
The `nth(n; expr)` function extracts the nth value output by `expr`.
Note that `nth(n; expr)` doesn't support negative values of `n`.
`first` and `nth` output `empty` if the generator has insufficient
elements. `last` returns `null` instead.
examples:
- program: "[first(range(.)), last(range(.)), nth(./2; range(.))]"
input: "10"
output: ["[0,9,5]"]
- program: "[[first(range(.))], [last(range(.))], [nth(5; range(.))]]"
input: "0"
output: ["[[],[null],[]]"]

- title: "`first`, `last`, `nth(n)`"
body: |
Expand All @@ -3017,16 +3023,10 @@ sections:
The `nth(n)` function extracts the nth value of any array at `.`.
`first` and `nth` output `empty` if the generator has insufficient
elements. `last` returns `null` instead.
examples:
- program: "[range(.)]|[first, last, nth(5)]"
input: "10"
output: ["[0,9,5]"]
- program: "[range(.)]|[[first], [last], [nth(5)]]"
input: "0"
output: ["[[],[null],[]]"]

- title: "`reduce`"
body: |
Expand Down

0 comments on commit bb8687a

Please sign in to comment.