My JSON data is structured as follows:
{
"error": false,
"data": {
"id": 1,
"name": "Jagadesha NH",
"email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8de8f5ece0fde1e8cdeae0ece4e1a3eee2e0">[email protected]</a>",
"phone": "9986XXXXXX",
"dob": "1991-06-01",
"gender": "m",
"active": 1,
"created_at": "2017-02-19 21:33:04",
"updated_at": "2017-02-19 21:33:04",
"profile": {
"id": 1,
"user_id": 1,
"picture": "https:\/\/placehold.it\/150x150",
"about": null,
"occupation": null,
"created_at": "2017-02-19 21:33:04",
"updated_at": "2017-02-19 21:33:04"
}
},
"msg": ""
}
Whenever I attempt to access the picture property, I encounter an error message that says:
cannot read property picture of undefined
The code I am using to retrieve the picture property is:
data.profile.picture