I am trying to construct an array for the week, with each element being an instance of my "work hours" class.
However, when attempting to define them within the array directly, I encounter an error. Upon inspecting the JS file, I noticed that the array is interpreted as
const week = [let, sunday = new WorkHours,
Is there a way to resolve this issue?
class WorkHours {
day: string;
night: string;
}
let sunday = new WorkHours;
let monday = new WorkHours;
let tuesday = new WorkHours;
let wednesday = new WorkHours;
let thursday = new WorkHours;
let friday = new WorkHours;
let saturday = new WorkHours;
const week = [
sunday,
monday,
tuesday,
wednesday,
thursday,
friday,
saturday,
]