下面展示一些 内联代码片
。
function Person(first, last, age, gender, interests) {
this.name = {
first,
last
};
this.age = age;
this.gender = gender;
this.interests = interests;
};
function Teacher(first, last, age, gender, interests, subject) {
Person.call(this, first, last, age, gender, interests);this.subject = subject;
};
function Brick() {
this.width = 10;
this.height = 20;
}
function BlueGlassBrick() {
Brick.call(this);
this.opacity = 0.5;
this.color = 'blue';
}
Teacher.prototype = Object.create(Person.prototype);
Teacher.prototype.constructor = Teacher;