Skip to content

Instantly share code, notes, and snippets.

@goofmint

goofmint/index.js

Created Jul 8, 2017
Embed
What would you like to do?
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