Currently struggling with this issue in my code:
I am unable to correctly initialize the nestedStudents
property. Every attempt results in an error suggesting the object may be undefined.
export class StudentDto {
students: number;
nestedStudents: {
grades: number;
classes: number;
}
constructor(
props: {
students?: number;
nestedStudents?: {
grades?: number
classes?: number
}
} = {},
) {
this.students = props.students || 0;
//How should I properly initialize nestedStudents in this section?
}
}