50
rated 0 times
[
53]
[
3]
/ answers: 1 / hits: 29172
/ 13 Years ago, mon, january 9, 2012, 12:00:00
How would you get a JSON path to a given child node of an object?
E.g.:
var data = {
key1: {
children: {
key2:'value',
key3:'value',
key4: { ... }
},
key5: 'value'
}
An variable with a reference to key4 is given. Now I'm looking for the absolute path:
data.key1.children.key4
Is there any way to get this done in JS?
Thank you in advance.
More From » json