Array: Difference between revisions
Content deleted Content added
→map/reduce: map(-(.)) |
|||
Line 63:
====Immutability====
jq offers a comprehensive collection of operators and functions for array processing, but to understand them it must be appreciated that all data values in
In fact, an expression such as "a[m] = 1" (where m is some non-negative integer) does not require that the length of the array, a, be at least (m+1). The expression should instead be interpreted to mean: produce an array derived from <tt>a</tt> such that a[m] == 1. If necessary, jq will add "null" elements to achieve this requirement. Thus, one way to create an array of m+1 nulls is to write:<lang jq>[][m] = null</lang>
|