LoginSignup
0
1

More than 5 years have passed since last update.

[TypeScript] 匿名クラス(内部クラス)

Last updated at Posted at 2018-10-17
確認環境
"typescript": "3.0.3"
TypeScriptコード
// 匿名クラスのインスタンス化
const inner = new class {
    /**
     * 匿名クラスのメソッド
     */
    public hello(name: string): void {
        // ログ出力
        console.log(`hello, ${name}`);
    }
}

// 実行
inner.hello(`Jon`);
コンソール出力
hello, Jon
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1