Skip to content

Instantly share code, notes, and snippets.

@nasustim
Last active October 9, 2022 08:15
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 nasustim/de004503f9896c1c720521738aa0637b to your computer and use it in GitHub Desktop.
Save nasustim/de004503f9896c1c720521738aa0637b to your computer and use it in GitHub Desktop.
// クラス名は仕方ない
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