Given javascript object:
obj = {
a: {
b: {
c: 3
}
}
}
I can access the deepest property as follows: obj['a']['b']['c']
or obj.a.b.c
. Now I want to access this using an array ['a', 'b', 'c']
. How can I access the same object property using this array?
Note: the method does not have to "safe", so no need to check for: typeError: cannot read property ... of undefined.