Is it possible to define a "path" to an object
key?
For instance if you have an object
:
var obj = {
hello: {
you: "you"
}
}
I would like to select it like this:
var path = "hello.you";
obj[path]; //Should return "you"
(Doesn't work obviously, but is there a way?)