ES5で子クラスのような動きをするコードでは super() に該当するコードを呼ぶことは必須ではありませんが、ES2015ではそれがないとエラーが発生します。 ES2015の子クラスの constructor() では、なぜ super() を最初に呼ぶ必要があるのでしょうか? 親クラスのコンストラクタが呼ばれていないのは、オブジェクトの状態として変だからでしょうか? であればなぜ暗黙に呼ばれるのではなく、明示的に記述しなければエラーが発生するようになっているのでしょうか? ES5 1var Parent = function () { console.log("Parent constructor"); }; 2Parent.prototype.parentMethod = function() { console.log("parentMethod"); } 3 4var Child
![ES2015の子クラスの constructor() では、なぜ super() を呼ぶ必要があるのか?](https://cdn-ak-scissors.b.st-hatena.com/image/square/d61d99447f3434c475f38686e3fcb4f6ab93528f/height=288;version=1;width=512/https%3A%2F%2Fteratail.com%2Fimg%2FogpImages%2FimgFacebookShare.png)