标签:return cal func this style ade parent span inherits
function inherits(Child,Parent){ var F = function(){}; F.prototype = Parent.prototype; Child.prototype = new F(); Child.prototype.constructor = Child; } function Student(props){ this.name = props.name || ‘WangXiang‘; }; Student.prototype.hello = function(){ alert(‘Hello,‘ + this.name + ‘!‘) }; function PrimaryStudent(props){ Student.call(this,props); this.grade = props.grade || 43; } inherits(PrimaryStudent,Student); PrimaryStudent.prototype.getGrade = function(){ return this.grade; }
标签:return cal func this style ade parent span inherits
原文地址:https://www.cnblogs.com/hzx-5/p/9589127.html