为什么编译器会这样说?
Argument of type '{ kind: "available"; | { kind: "notAvailable"; } | undefined' is not assignable to parameter of type 'Schedule'. Type 'undefined' is not assignable to type 'Schedule'.
绝对无法将'undefined'放入availableTimeShiftsByHoursTables
let availableTimeShiftsByHoursTables: Schedule[] = new Array();
scheduleInfo.map(element => {
if (element.schedules.get(targetDate)) {
availableTimeShiftsByHoursTables.push(
element.schedules.get(targetDate)
);
}
});