Skip to content

Instantly share code, notes, and snippets.

@TheCodingLady
Last active March 30, 2018 06:00
Show Gist options
  • Save TheCodingLady/521afff701277f74fa730c2fa31440c9 to your computer and use it in GitHub Desktop.
Save TheCodingLady/521afff701277f74fa730c2fa31440c9 to your computer and use it in GitHub Desktop.
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