function makeHtml(response) {
$.each(response.workers,function(i){
$.each(response.dutchDays,function(j) {
var dayFrom = 'day'+j+'from';
console.log(response.workers[i].dayFrom); // This is showing me undefined
}
}
dutchDays:{1: "Maandag:", 2: "Dinsdag:", 3: "Woensdag:", 4: "Donderdag:", 5: "Vrijdag:", 6: "Zaterdag:",…}
timeArray:["00:00:00", "00:30:00", "01:00:00", "01:30:00", "02:00:00", "02:30:00", "03:00:00", "03:30:00",…]
workers:[{"workerid":"51","barberid":"41","name":"Mo","workerEmail":"nkm_mootje@hotmail.com","worker_time_id":"57","time_needed":"30","day1from":"12:00:00","day1to":"18:00:00","day2from":"09:00:00","day2to":"18:00:00","day3from":"09:00:00","day3to":"18:00:00","day4from":"09:00:00","day4to":"20:30:00","day5from":"09:00:00","day5to":"18:00:00","day6from":"09:00:00","day6to":"18:00:00","day7from":"05:00:00","day7to":"12:30:00"}]
This is my function in which i want to use dynamic day1from and day1to , day2from and day2to... from workers json array in jquery each loop. it shows me undefined.