[ ... snip ]

> class Animal {
>>
>>     constructor(name){
>>
>>         this.name = name;
>>
>>     }
>>
>>     move(meters){
>>
>>         alert(this.name + " moved " + meters + "m.");
>>
>>     }
>>
>> }
>>
>
Russ,

I'm trying to write up some supporting examples, but ran into a snag
regarding "static" properties. eg

function Foo( stuff ) {
  this.stuff = stuff || "";
}

Foo.prototype.getStuff = function() {
  return this.stuff;
};

Foo.Bar = function() {
  return new Foo("bar");
};


How would I make Foo.Bar ?


Rick
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to