1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
class Employee { constructor(name) { this.name = name; } getName() { return this.name; } fire(target) { if (target instanceof Employee) { console.log("I am an employee, I cannot fire someone!"); } else { console.log("I cannot fire that!"); } return false; } } module.exports = { Employee, };