Learn Javascript Classes School Catalogue


I am receiving an error here, and I don’t understand why:
ReferenceError: this is not defined
at new PrimarySchool

This is the code I have:
class School {
constructor(name, numberOfStudents, level) {
this._name = name;
this._numberOfStudents = numberOfStudents;
this._level = level;

class PrimarySchool extends School {
constructor(name, numberOfStudents, pickupPolicy) {
this._level = ‘primary’;
this._pickupPolicy = pickupPolicy;


I figured it out. It should be super(name, numberOfStudents)