Currently, I am dealing with a results API that provides me with a JSON file. My goal is to search for a specific property within this file. To achieve this, I first push the JSON data into an empty array and then iterate over it to retrieve the first object successfully. However, here's where I face a challenge - all objects from the JSON file are stored in one large object inside the array. So logically, my next step was to loop over this large object to access its content. Unfortunately, my attempts have been unsuccessful so far as I receive no output. Do I require an additional looping mechanism to tackle this issue? I've shared everything I can below. Furthermore, I've extensively researched this problem but haven't found a solution, hence I apologize if this question resembles a duplicate. In such case, I'd greatly appreciate a simple link or resource to refer to. Thank you for your assistance.
JSON:
{
"0":{
"person_id":"001583133371",
"source":"lexis",
"phone_number":"",
"first_name":"Brian",
"middle_name":"JOSEPH",
"last_name":"Name",
"aliases":[...],
"street":"",
...
},
...
}
The objective is to extract the 'zip' property for each object in the 'whereAt' array. Ignore the MQA details provided above. The existing code functions correctly but only retrieves the 'zip' property of the first object in the array. I'm seeking a solution to gather all 'zip' properties and display them on the console. Any assistance offered will be highly valued, and I'm willing to provide any additional information required to tackle this concern effectively. Once again, thank you for dedicating your time to help out.