构造函数+原型的js混合模式

function Parent(){
  this.name = "李小龙";
  this.age = "30"; 
};
Parent.prototype.lev=function(){
  return this.name;
}
var x=Parent();
alert(x.name);
alert(x.lev());

原文地址:https://www.cnblogs.com/yuyedaocao/p/9736317.html