On my app I have an object of dates which contains time array like Console log output is as follows
32: {
1514160000: Array [ 1200, 1500 ],
1514764800: Array [ 1200, 1500 ],
1515369600: Array [ 1200, 1500 ],
1515974400: Array [ 700, 1200, 1500 ],
1516579200: Array [ 700, 1200, 1500 ],
}
With this data I have implemented loop to create a new array of dates with time and worker id as follows ( similar to this )
1514160000 :[
1200 : [32,40,56],
1500 : [32,40],
],
1514764800: [
1200 : [32,40,56],
1500 : [32,40],
]
I have written following code for this where I want to create array of dates by dynamically assign dates and then create it an array again.
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 = [];
}
}
}
where allAvailableProviders is object
It gives me following error on ng serve
'=' expected
How can I do it ?
any?