l
export class Game {
id: number;
home: string;
away: string;
score_home: number;
score_away: number;
// ещё до хера полей
}есть класс, описывающий как изменилась игра
export class GameChanges {
id: number;
order: number | null;
score_home: number | null;
score_away: number | null;
in_play: boolean | null;
time: string | null;
// и т.д. - ещё до хера полей
}у класса Game есть метод, которая применяет изменения
applyGameChanges (a:GameChanges) {
this.order = a.order ? a.order : this.order;
this.score_home = a.score_home ? a.score_home : this.score_home;
this.score_away = a.score_away ? a.score_away : this.score_away;
this.in_play = a.in_play ? a.in_play : this.in_play;
// и т.д.
};Вопрос такой - как нормально переписать applyGameChanges в обощённом виде, чтобы какой то цикл по всем полям обеих классов?
