タグ

ブックマーク / qiita.com/teramoh (1)

  • クラスの書き方と継承 - Qiita

    (2018/10/15編集)この内容すごいJSビギナーの時に書いたやつでして javascariptはclassやextends使えるので参考にしないほうがいいです。 とりあえずCompositeパターンで なんとなくいい感じで記述できてるような気がせんでもないが constructorとそれに付随する引数を取り入れたい… var Component= function(){}; (function(){ var _this_ = Component.prototype; ////プロパティ//// _this_.parent; _this_.name = "Component.prototype"; ////メソッド//// //for Leaf and Conmpsite _this_.operation = function(){ console.log(this.name + "

    クラスの書き方と継承 - Qiita
    kasumani
    kasumani 2014/08/24
    クラスの書き方と継承 とりあえずCompositeパターンで なんとなくいい感じで記述できてるような気がせんでもないが constructorとそれに付随する引数を取り入れたい… このモジュールを利用して継承させる。 調べたらNode. Tags:
  • 1