Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Inheritance_Manager = {};
- Inheritance_Manager.extend = function (subClass, baseClass) {
- function inheritance() { };
- inheritance.prototype = baseClass.prototype;
- subClass.prototype = new inheritance();
- subClass.prototype.constructor = subClass;
- subClass.baseConstructor = baseClass;
- subClass.superClass = baseClass.prototype;
- }
- function Human(age, grade){
- this.age = age;
- this.grade = grade
- }
- function Student(age, gender, grade){
- Student.baseConstructor.call(this, age, grade);
- this.gender = gender;
- }
- Inheritance_Manager.extend(Student, Human);
Advertisement
Add Comment
Please, Sign In to add comment