Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created July 8, 2017 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goofmint/ba85318680d7ca849b9233ad2816ac87 to your computer and use it in GitHub Desktop.
Save goofmint/ba85318680d7ca849b9233ad2816ac87 to your computer and use it in GitHub Desktop.
method: {
constructor: function (initialValue) {
// 親クラスのコンストラクタ呼び出し
super_.constructor.call(this);
// 初期値を設定(インスタンス生成時に指定)
this._count = initialValue;
// 初期値を設定(直接指定)
this.scale = 1;
},
increment: function () {
++this._count;
return;
},
getValue: function () {
return this._count * this.scale;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment