1,属性继承
继承:子级继承父级的一些属性或者方法
call apply:专门用来实现属性的继承
function Person(name,age,sex){
this.name = name; this.age = age; this.sex = sex;}Person.prototype.eat = function(){
console.log("正在吃饭")} Person.prototype.sleep = function(){ console.log("正在睡觉")} function Man(larynx,beard,name,age,sex,){ Person.call(this,name,age,sex)this.larynx = larynx;
this.beard = beard;}Man.prototype.work = function(){
console.log('111')} var songlei = new Man(10,20);console.log(songlei);