I'm receiving data from a controller that looks like this when I console.log:
{1: {…}, 2: {…}, 3: {…}}
1: {datasetID: 1, title: "Adirondack Trout Survey", year: "2015", ADD-startYr: "2015", ADD-endYr: "2015", …}
2: {datasetID: 2, title: "Adirondack Trout Survey", year: "2016", ADD-startYr: "2016", ADD-endYr: "2016", …}
3: {datasetID: 3, title: "Adirondack Trout Survey", year: "2017", ADD-startYr: "2017", ADD-endYr: "2017", …}
I'm trying to access the datasetIDs and this was my attempt:
$(data).each(function(i, d){
console.log(d.datasetID);
}
But I am getting undefined returned. I'm not sure how to loop through that object and get the dataset IDs?
Thanks!