Model a School System with Hierarchical Classes Using OOP Principles

Design a set of JavaScript classes to model a School system: School, Department, Teacher, Student, and Course. Apply core OOP principles — encapsulation (private fields), inheritance (Student/Teacher extend Person), polymorphism (override a toString or report() method), and abstraction (abstract base class with shared behavior). Implement real methods like enroll(), assign(), and generateReport(). This is the go-to OOP design problem asked at companies testing JS class syntax mastery.

Examples
Input: []
Output:
Hints

Model a School System with Hierarchical Classes Using OOP Principles

Design a set of JavaScript classes to model a School system: School, Department, Teacher, Student, and Course. Apply core OOP principles — encapsulation (private fields), inheritance (Student/Teacher extend Person), polymorphism (override a toString or report() method), and abstraction (abstract base class with shared behavior). Implement real methods like enroll(), assign(), and generateReport(). This is the go-to OOP design problem asked at companies testing JS class syntax mastery.