I have an object with a large nesting. I can change its content like this:
children.props.children.props.children = 'test'
I can do this:
children['props']['children']['props'].children = 'test'
I want to do this by having the path in a variable
let path = ['props','children','props']
I tried like this:
let path = ['props','children','props']
children[path].children = 'test'
let path = [['props'],['children'],['props']]
children[path].children = 'test'
But it doesn't work. Please tell me how can I use the "path" variable