
エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
TypeError: Class constructor cannot be invoked without 'new' - Qiita
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
TypeError: Class constructor cannot be invoked without 'new' - Qiita
const A = class { constructor(_a) { this.a = _a; } } const B = class extends A { constructor(_b) ... const A = class { constructor(_a) { this.a = _a; } } const B = class extends A { constructor(_b) { super(_b); } } (() => { var b = new B("test"); console.log(b); })(); とあるJavaScriptを試したところ「TypeError: Class constructor cannot be invoked without 'new'」が出た。 エラーの原因は何? 普通のclass class A { constructor(_a) { this.a = _a; } } class B extends A { constructor(_b) { super(_b); } } (() => { var b = new B("test