Last active
March 30, 2018 06:00
-
-
Save TheCodingLady/521afff701277f74fa730c2fa31440c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Monster { | |
constructor (name, health, ...args) { | |
this.name = 'Nessie' | |
this.health = 100; | |
this.size = 90; | |
this.color = 'purple'; | |
this.habitat = 'water'; | |
this.exterior = 'hairless'; | |
this.food = 'plankton'; | |
} | |
heal() { | |
result = this.health + 10; | |
} | |
} | |
class MiniMonster extends Monster { | |
constructor (name, health, size); | |
this.name = name; | |
this.health = 50; | |
this.size =< 40; | |
miniheal() { | |
result = this.health + 5; | |
} | |
} | |
get options() { | |
return name + result; | |
let s = new MiniMonster(Spot, 50, 15); | |
s.miniheal() | |
console.log(Monster(options(name, result)); | |
// in lib.js | |
export const = Monster.options; | |
export function heal() { | |
return 100 + 10 || 50 + 5; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment