I have an array of objects with a tab_id
and pane_id
fields.
I would like to return the tab_id
s of the first object whose pane_id
field matches the value of an environment variable.
I am also interested in returning the tab_id
of only the first match
Here is a sample file :
[
{
"tab_id": 0,
"pane_id": 0,
},
{
"tab_id": 0,
"pane_id": 1,
},
{
"tab_id": 0,
"pane_id": 2,
},
{
"tab_id": 1,
"pane_id": 3,
},
{
"tab_id": 2,
"pane_id": 4,
}
]
So in this case, if my environment variable is 2, I need the tab_id
value of the object whose pane_id
is 2, that is 0