diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:08:27 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:08:27 +0200 |
| commit | c9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c (patch) | |
| tree | 3e4f42f93c7ae89a364e4d51fff6e5cec4e55fa9 /graphs/js/myCompany/boss.js | |
add: graphs et rushs
Diffstat (limited to 'graphs/js/myCompany/boss.js')
| -rw-r--r-- | graphs/js/myCompany/boss.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/graphs/js/myCompany/boss.js b/graphs/js/myCompany/boss.js new file mode 100644 index 0000000..eadf09c --- /dev/null +++ b/graphs/js/myCompany/boss.js @@ -0,0 +1,30 @@ +const { Employee } = require("./employee"); + +class Boss extends Employee { + constructor(name, accreditationLevel) { + super(name); + this.accreditationLevel = accreditationLevel; + } + getAccreditation() { + return this.accreditationLevel; + } + fire(target) { + if (!(target instanceof Employee)) { + console.log("I cannot fire that!"); + return false; + } else if ( + !(target instanceof Boss) || + target.getAccreditation() < this.accreditationLevel + ) { + console.log(target.getName() + " you are fired!"); + return true; + } else { + console.log("I cannot fire someone superior to me!"); + return false; + } + } +} + +module.exports = { + Boss, +}; |
