School Catalogue

HI!
I’m trying to understand why when I try to console.log(alSmith.sportsTeams); it shows as undefined in the console.
Any tips?

class School { constructor(name, level, numberOfStudents) { this._name = name; this._level = level; this._numberOfStudents = numberOfStudents; } get name() { return this._name; } get level() { return this._level; } get numberOfStudents() { this._numberOfStudents; } set numberOfStudents(newNumberOfStudents) { //other option if(value.isNaN()) instead of the typeof if (typeof newNumberOfStudents === "number") { return this._numberOfStudents; } else { console.log("Invalid input: numberOfStudents must be set to a Number."); } } quickFacts() { console.log( `${this._name} educates ${this._numberOfStudents} students at the ${this.level} school level` ); } static pickSubstituteTeacher(substituteTeachers) { const randomTeacher = Math.floor(Math.random()* substituteTeachers.length ); return substituteTeachers[randomTeacher]; } } class PrimarySchool extends School { constructor(name, numberOfStudents, pickupPolicy) { super(name, "primary", numberOfStudents); this._pickupPolicy = pickupPolicy; } get pickupPolicy() { return this._pickupPolicy; } } class MiddleSchool extends School { constructor(name, numberOfStudents) { super(name, "middle", numberOfStudents); } } class HighSchool extends School { constructor(name, numberOfStudents, sportsTeams) { super(name, "high", numberOfStudents); this._sportsTeams = sportsTeams; } get sportsTeam() { return this._sportsTeams; } } const lorraineHansbury = new PrimarySchool( "Lorraine Hansbury", 514, "Students must be picked up by a parent, guardian, or a family member over the age of 13." ); lorraineHansbury.quickFacts(); const subTeachers = School.pickSubstituteTeacher([ "Jamal Crawford", "Lou Williams", "J. R. Smith", "James Harden", "Jason Terry", "Manu Ginobli", ]); const alSmith = new HighSchool("Al E. Smith", 415, [ "Baseball", "Basketball", "Volleyball", "Track and Field", ]); console.log(alSmith.sportsTeams); alSmith.quickFacts();

You have a getter for sportsTeam and the property _sportsTeams in the class definition HighSchool. But none for sportsTeams.