Array: Difference between revisions
Content added Content deleted
(→Immutability: ce) |
(→Basic Array Operations: [][n] = null) |
||
Line 71:
Assuming a and b are arrays, and if m and n are non-negative integers:
<lang jq>
[][n] =
[range(0;n)] # => [0,1, ... (n-1)]
a | length # => the length of a
Line 78:
a[-1] # => the last element (or null)
a[m:n] # => the subarray [a[m], ..., a[n-1]]
</lang>
====Streams and Arrays====
jq provides support for streams of JSON entities, and thus the syntax for converting between an array and the stream of entities that an array contains is fundamental to jq. In brief:
|