I want to find the key:value if exists somewhere nested. My JSON looks like this
{
"key1": {
"key11": "foo11",
"key12": "foo12",
"key13": [
"aaa",
"bbb"
]
},
"key2": {
"city": "New York",
"state": "NY",
"phone": [
"20111",
"20333"
]
}
}
I need to find first occurrence e.g. "phone" key and get it's data. How to do it by using e.g. lodash rather than for/forEach. The key "phone" may or may not exist and not in first level primary object.. So I need first occurrence