2009-06-02から1日間の記事一覧
クロージャを使ってクラス定義する例が以下。 function FooClass(a) { this.getA = function() { return a; } this.square = function() { return a * a; } } prototypeを使ってクラス定義する例が以下。 function BarClass(a) { this.a = a } BarClass.prot…
クロージャを使ってクラス定義する例が以下。 function FooClass(a) { this.getA = function() { return a; } this.square = function() { return a * a; } } prototypeを使ってクラス定義する例が以下。 function BarClass(a) { this.a = a } BarClass.prot…