Search key and return value in nested object
问题 Lets say my object looks like the below. Its a mix of different arrays and parents, no hierarchical order. e.g. "person": { "id": 12345, "name": "John Doe", "emergencyContacts": [ { "name": "Jane Doe", "phone": "888-555-1212", "relationship": "spouse", "moreDetails": { "id": 12345, "phones": {}, "home": "800-123-4567", "mobile": "877-123-1234" } }, { "name": "Justin Doe", "phone": "877-123-1212", "relationship": "parent", "mobile": "877-123-1234" } ], "workContacts": [ { "name": "Jane Doe",