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:
User.jsexport default class User {
}
Let us inherit another class from this class:
Student.jsexport default class Student extends User {
}
In this case, the parent class must be connected to the child class:
Student.jsimport User from './User.js';
export default class Student extends User {
}
Задание 1
Place the Programmer class in a separate file.
Задание 2
Make the Programmer class inherit from the Employee class.