Ap3twe
1 month ago

Loop through array Json

Posted 1 month ago by Ap3twe

Hey I am having trouble looping through JSON. I am using for loop but can't access response

{total: 10000, total_pages: 1000, results: Array(10)}
results: Array(10)
0:
cover_photo:
alt_description: "pea pods"
categories: []
color: "#37510D"
created_at: "2018-07-17T16:04:26-04:00"
1: 
cover_photo:
alt_description: "pea pods"
categories: []
color: "#37510D"
created_at: "2018-07-17T16:04:26-04:00"

}
for(let i = 0; i < jsonData.length; i++){  
         var j = jsonData[i].color;
cosole.log(j);
}

Please sign in or create an account to participate in this conversation.