Trouble with School Catalog

when i made an instance for primary school, the compiler said that PrimarySchool is undefined. Everything is spelled right and i see no coding errors so what’s wrong with my Primary subclass?
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(){
return this._numberOfStudents
}
set numberOfStudents(newNumberOfStudents){
if (typeof newNumberOfStudents === ‘newNumberOfStudents’){
return this._numberOfStudents
} else{console.log(‘Invalid number’)}
}
quickFacts(){
console.log (${this.name} educates ${this.numberOfStudents} students at the ${this.level} school level.)
}
static pickSubstituteTeacher(substituteTeachers){
const randInt = Math.floor(substituteTeachers.length*Math.random())
return substituteTeachers[randInt]
}
}
class PrimarySchool extends School{
constructor(name,numberOfStudents,pickupPolicy){
super(name,‘primary’,pickupPolicy)
this._pickupPolicy = pickupPolicy
}
get pickupPolicy(){
return this._pickupPolicy
}
};
class HighSchool extends School{
constructor(name,numberOfStudents,sportsTeams){
super(name,‘high’,sportsTeams)
this._sportsTeams = sportsTeams

}

get sportsTeams(){
return this._sportsTeams
}
}

const lorraineHansbury = new PrimaryShool(‘Lorraine Hansbury’,514,‘Students must be picked up by a parent, guardian, or a family member over the age of 13.’)

console.log(lorraineHansbury.quickFacts())

Why hand a property to super only to override it?

1 Like

which one? pickupPolicy?

i changed pickupPolicy to numberOfStudents. The compiler still throws the same error

Try not passing pickupPolicy to the parent.

2 Likes

You have a typo in the line creating const LorraineHansbury =.

Check that line.

2 Likes