Reputation: 12520
I have an object that is just a bunch of arbitrary keys with each an array:
{
"foo": [
"hello",
"world"
],
"bar": [
"foobar"
]
}
How can I return the merged arrays in this object. The expected output would be:
[
"hello",
"world",
"foobar"
]
Upvotes: 1
Views: 120
Reputation: 439
Create a list of the values and concatenate the elements in that list:
[.[]] | add
Create a list of each element in each array:
[.[][]]
I'd prefer the first one since it parses easier in my mind.
Upvotes: 3