O'REILLYの「開眼!JavaScript」を読んで以下の2つのコンストラクタがあるのですが、どういう違いがあるのか教えてほしいです。
コンストラクタ関数に名前をつけたかつけなかったかというだけの違いなのか、重大な違いがあるのか気になります。
よろしくお願いいたします。
6ページのソース
JavaScript
1var Person = function (living, age, gender) { 2 this.living = living; 3 this.age = age; 4 this.gender= gender; 5 this.getGender = function() { 6 return this.gender; 7 }; 8}; 9 10var hoge = new Person(true, 32, 'male');
8ページのソース
JavaScript
1var Person = function Person(living, age, gender) { 2 this.living = living; 3 this.age = age; 4 this.gender= gender; 5 this.getGender = function() { 6 return this.gender; 7 }; 8}; 9 10var hoge = new Person(true, 32, 'male');

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/02/22 06:38
2016/02/22 15:51
2016/02/23 00:20