I have a multi-dimensional object like this one:
var map = {
"a": {
"aa": {
"aaa": "red",
"aab": "green"
},
"ab": "blue"
}
"b": {
"ba": "orange"
}
}
What I need is a function that would allow something such like:
var foo = getSubValue(map, "a.ab"); // "blue"
The second parameter of this sample has to be a string. I can't use the following:
var foo = map.a.ab
Any Idea of how to proceed, or of an existing implementation ? Thanks for your help.