Encountering an error while attempting to loop through my JSON object using a foreach. Any assistance would be greatly appreciated.
Snippet of my JavaScript code:
function dateTimeChecker() {
$.ajax({
"url": 'get-booked.php',
"method": "get",
"dataType": "text",
"cache": false
}).done(function(jBooked) {
var jBookedDates=JSON.parse(jBooked);
console.log(jBookedDates);
jBookedDates.forEach(function(jB){
if (jB=="11/01/2016") {console.log("works");}else{console.log("doesn't");}
})
});
}
Providing the link to the object discussed:
https://i.sstatic.net/5csV3.png
I am curious about how I can successfully iterate over this object - any insights are welcome :)