Last active
October 9, 2022 08:15
-
-
Save nasustim/de004503f9896c1c720521738aa0637b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// クラス名は仕方ない | |
class Bar{ | |
// コンストラクタは仕方ない | |
constructor(){ | |
this.変数 = 0; | |
this.defineMethods(); | |
} | |
defineMethods(){ | |
// メンバ変数に関数を代入 | |
this.メソッド = () =>{ | |
this.変数++; | |
}; | |
} | |
} | |
// これで解決 | |
const _バー = new Bar(); | |
_バー.メソッド(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment