Say I have an object
const someObject = {
foo: 'bar',
baz: {
abc: [
'def',
'ghi'
]
}
}
And a dynamically generated array with a path to the value needed
const someArray = ['baz', 'abc', 1]
How can I access the object value based on array values?
In the example it would return 'ghi'