js 面向对象学习六 几种面向对象写法的对比

js 面向对象学习6 几种面向对象写法的对比方法一function Person(age,name){this.ageagethis.namename

js 面向对象学习6 几种面向对象写法的对比
方法一

function Person(age,name){       this.age=age;       this.name=name;       if(typeof Person._initialized=='undefined'){             Person.prototype.showName=function(){                     console.log(this.name);             }             Person._initialized=true;        }}
?

开发者经过大量的实践在js面向对象编程中发现的比较科学的方法。

?

?