summaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin.c b/builtin.c
index aa3c888a..087741fa 100644
--- a/builtin.c
+++ b/builtin.c
@@ -676,6 +676,8 @@ static const char* const jq_builtins[] = {
"def from_entries: map({(.key): .value}) | add;",
"def with_entries(f): to_entries | map(f) | from_entries;",
"def reverse: [.[length - 1 - range(0;length)]];",
+ "def index(i): .[i][0];",
+ "def rindex(i): .[i][-1:][0];",
};