Sep 27 meeting notes

Erik Arvidsson erik.arvidsson at gmail.com
Thu Sep 29 17:11:37 PDT 2011


On Thu, Sep 29, 2011 at 17:08, Bob Nystrom <rnystrom at google.com> wrote:
> class Monster {
>   constructor(this.name, this.health) {}
>
>   attack(target) {
>     log(Monster.attackMessage);
>   }
>
>   get isAlive() {
>     return this.health > 0;
>   }
>
>   set health(value) {
>     if (value < 0) throw new Error('Health must be non-negative.')
>     this.health = value
>   }
>
>   let numAttacks = 0;
> class:
>   const attackMessage = 'The monster hits you!';
> }

+1

-- 
erik


More information about the es-discuss mailing list