Constructor in OOP in JavaScript
There is a special method that will be called when a new class object is created. This method is called constructor. Let's implement it in our class:
javascriptclass User {
constructor() {
console.log('+++');
}
}
Let's now create an object of the class and make sure that the method is called:
javascriptnew User; // will bring out '+++'
Задание 1
Make a constructor for the Employee class.