My application contains an object with dates and corresponding time arrays. The console log output is displayed below:
32: {
1514160000: Array [ 1200, 1500 ],
1514764800: Array [ 1200, 1500 ],
1515369600: Array [ 1200, 1500 ],
1515974400: Array [ 700, 1200, 1500 ],
1516579200: Array [ 700, 1200, 1500 ],
}
Using this data, I have created a loop to generate a new array of dates with times and worker IDs as shown below (similar structure):
1514160000 :[
1200 : [32,40,56],
1500 : [32,40],
],
1514764800: [
1200 : [32,40,56],
1500 : [32,40],
]
The code snippet I wrote for this purpose creates an array of dates by dynamically assigning date values and then converting it into another array.
let allDates :any = [];
for(let pid in this.allAvailableProviders)
{
console.log(pid);
for(let slotDate in this.allAvailableProviders[pid]){
if(!Array.isArray(allDates[slotDate])){
let allDates[slotDate] :any = [];
}
}
}
The variable allAvailableProviders is an object in this context.
When running the command ng serve, I encounter the following error:
'=' expected
How can I resolve this issue?