Classes, Modules, and Inheritance in OOP in JavaScript
Let's look at how to inherit classes placed in modules. Let's say we have the following class:
export default class User {
}
Let us inherit another class from this class:
export default class Student extends User {
}
In this case, the parent class must be connected to the child class:
import User from './User.js';
export default class Student extends User {
}
Place the Programmer class in a separate file.
Make the Programmer class inherit from the Employee class.