const object = {
key1: 'example_key1',
key2: {
key3: 'example_key2'
}
}
const string = 'key1'
const array = ['key2', 'key3']
object[string] = 'foo' // Work
object[array] = 'bar' // Dont work
How can I access and change the object with the array of keys?
I have tried loadash.get but it can only get values not change them.
object[array]to return?