I have a nested array of objects i need to change the values of a children data dynamically
[
{
type: "root",
title: "FileManager",
isDirectory: true,
children: [
{
type: "folder",
title: "animals",
isDirectory: true,
children: [
{
type: "folder",
title: "cat",
isDirectory: true,
children: [
{
type: "folder",
title: "images",
isDirectory: true,
children: [
{
type: "file",
title: "cat001.jpg",
isDirectory: false,
}, {
type: "file",
title: "cat002.jpg",
isDirectory: false,
}
]
}
]
}
]
},
{
type : "folder",
title : 'Birds',
isDirectory : true,
children : []
}
]
}
]
this is my main array of object suppose if i want to change the value of children dynamically. lets take i want to add one more object to the children inside images array so the path of the images array is FileManager / animals / cat / images how can change the value of the children in the images object dynamically?