Example:
var someObject = {
'part1' : {
'name': 'Part 1',
'txt': 'example',
},
'part2' : {
'name': 'Part 2',
'size': '15',
'qty' : '60'
},
'part3' : [
{
'name': 'Part 3A',
'size': '10',
'qty' : '20'
}, {
'name': '[value]',
'size': '5',
'qty' : '20'
}, {
'name': 'Part 3C',
'size': '7.5',
'qty' : '20'
}
]};
I need a function to get the path of the object to the value "[value]" which can be anywhere on the object
This object will be passed by the User, for this reason I will not know the structure of it.
something like:
getPath(obj, '[value]');
[value]exists multiple times and on different paths?