export class GradeSchool {
constructor() { this._roster = {}; }
roster() { return JSON.parse(JSON.stringify(this._roster)); }
add(name, grade) {
for (const g in this._roster) this._roster[g] = this._roster[g].filter(n => n !== name);
this._roster[grade] = [...(this._roster[grade] || []), name].sort();
}
grade(grade) { return [...(this._roster[grade] || [])]; }
}