3 ms·
The 2nd and 3rd examples make no sense to me. echo '{"a": 1, "b": 2}' | jaq 'add' 3 Construct an array from an object in two ways and show that they are equa
by jbritton 3y ago
The 2nd and 3rd examples make no sense to me.
echo '{"a": 1, "b": 2}' | jaq 'add'
3
Construct an array from an object in two ways and show that they are equal:
$ echo '{"a": 1, "b": 2}' | jaq '[.a, .b] == [.[]]'
true
- wwader 3y agoWhat might be confusing is that iterating an object iterates its values. add is defined something like this: def add: reduce .[] as $n (0; . + $n)