I have this following object
{
"Monday": [
{
"morning": [
{
"start_time": "02:00",
"end_time": "07:30"
}
],
"afternoon": [
{
"start_time": "02:00",
"end_time": "05:00"
}
],
"evening": [
{
"start_time": "02:30",
"end_time": "07:00"
}
]
}
],
"Tuesday": [
{
"morning": [
{
"start_time": "02:00",
"end_time": "07:30"
}
],
"afternoon": [
{
"start_time": "02:00",
"end_time": "05:00"
}
],
"evening": [
{
"start_time": "02:30",
"end_time": "07:00"
}
]
}
],
..
}
i want to loop through all object keys and values
for (var prop in this.jsonData) {
console.log("Key:" + prop);
console.log("Value:" + this.jsonData[prop]);
}
getting
Key:Monday value : undefined
but i need to access inner object values.
this
context, as it's not clear what that is in your example code).