How do I retrieve the list of objects under the entities and ministries keys respectively in javascript from the sample JSON string provided? Your help will surely be appreciated.
Note: The list was created from a PHP script using the "json_encode" function
Sample JSON String
[
{
"entities":[
{
"id":5,
"entity_name":"Limited",
"ministry_id":5,
"entity_description":"Technology providers",
"created_at":"2019-05-01 00:00:00",
"updated_at":null
},
{
"id":6,
"entity_name":"eLearning",
"ministry_id":1,
"entity_description":"Provides an educational portal for students",
"created_at":"2019-05-01 00:00:00",
"updated_at":null
}
],
"ministries":[
{
"id":5,
"name":"Science"
},
{
"id":1,
"name":"Finance"
}
]
}
]