I have an array of objects that looks like this:
[
{
"text":"Same but with checkboxes",
"opened": true,
"children":[
{
"text":"initially selected",
"opened":true
},
]
},
{
"text":"Same but with checkboxes",
"opened":true,
"children":[
{
"text":"initially open",
"opened":true,
"children":[
{
"text":"Another node",
"opened":true,
}
]
},
{
"text":"custom icon",
"opened":true,
},
{
"text":"disabled node",
"opened":true,
}
]
},
{
"text":"And wholerow selection",
"opened":true,
}
]
I want to know if it is possible to change the value for example of the key opened (to false) to all objects at all levels .. how can I do this?
I tried something like that without success
myArray.map(e => ({ ...e, opened: false }))