fix: make last(empty) yield no output values (#3179)

This commit is contained in:
itchyny authored and GitHub committed 2024-11-13 20:35:50 +09:00
1 parent 3c5707f7fb
commit a7b22539a4
6 files changed
+46 -4

No files matched your search

Generated
+5 -1
View File
@@ -3475,9 +3475,13 @@ The \fBnth(n; expr)\fR function extracts the nth value output by \fBexpr\fR\. No
.
.nf
jq \'[first(range(\.)), last(range(\.)), nth(\./2; range(\.))]\'
jq \'[first(range(\.)), last(range(\.)), nth(5; range(\.))]\'
10
=> [0,9,5]
jq \'[first(empty), last(empty), nth(5; empty)]\'
null
=> []
.
.fi
.