I have this large object that has the key 'visible' peppered throughout it. I use it to show/hide an item in the UI.
However, I have these buttons named 'Show All' / 'Collapse All' where I would like to change the value for the key 'visible' accordingly. So it shows/hides all the content at once.
The object looks something like this:
{
  toplevelkey: [
    {
      innerKey: someValue,
      visible: false
    },
    {
      innerKey: someValue,
      visible: false
    }
  ],
  visible: true
}
I tried using recursion to solve this, but it didn't really help.
 
     
    