Return a subrange of elements.
Section: Selectors and Paths
Slice an array
bash
bash
echo '[10,20,30,40,50]' | jq '.[1:4]'Explanation
This returns elements at indexes 1 through 3.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Selectors and Paths