function HNU_student(name) {
this.name = name;
this.sayName = function() {
return this.name;
};
}
HNU_student.prototype = {
school: 'HNU',
saySchool: function() {
return this.school;
}
};
Object.defineProperty(HNU_student, 'constructor', {value: HNU_student});
var hiyohoo = new HNU_student('xujian');
function object(o) {
function F() {};
F.prototype = o;
return new F();
}
function inheritPrototype(child, parent) {
var prototype = object(parent.prototype);
prototype.constructor = child;
child.prototype = prototype;
}
function HNU_student(name) {
this.name = name;
this.sayName = function() {
return this.name;
};
}
HNU_student.prototype.school = 'HNU';
HNU_student.prototype.saySchool = function() {
return this.school;
};
function Student_2011(name, number) {
HNU_student.call(this, name);
this.number = number;
this.sayNumber = function() {
return this.number;
}
}
inheritPrototype(Student_2011, HNU_student);
Student_2011.prototype.graduationTime = 2015;
Student_2011.prototype.sayGraduationTime = function() {
return this.graduationTime;
};
var hiyohoo = new Student_2011('xujian', 20110803203);
function HNU_student(name) {
this.name = name;
this.sayName = function() {
return this.name;
};
if (!HNU_student.prototype.school) {
HNU_student.prototype.school = 'HNU';
HNU_student.prototype.saySchool = function() {
return this.school;
};
}
}
var hiyohoo = new HNU_student('xujian');
function SpecialArray() {
var values = new Array();
values.push.apply(values, arguments);
values.toPipedString = function() {
return this.join('|');
};
return values;
}
var colors = new SpecialArray('red', 'black', 'white');
function HNU_student(name) {
this.name = name;
this.sayName = function() {
return this.name;
};
}
HNU_student.prototype.school = 'HNU';
HNU_student.prototype.saySchool = function() {
return this.school;
};
function Student_2011(name, number) {
HNU_student.call(this, name);
this.number = number;
this.sayNumber = function() {
return this.number;
};
}
Student_2011.prototype = new HNU_student();
Student_2011.prototype.constructor = Student_2011;
Student_2011.prototype.graduationTime = 2015;
Student_2011.prototype.sayGraduationTime = function() {
return this.graduationTime;
}
var hiyohoo = new Student_2011('xujian', 20110803203);
function object(o) {
function F() {}
F.prototype = o;
return new F();
}
var student1 = {
school: 'HNU',
saySchool: function() {
return this.school;
}
};
var student2 = object(student1);
var student1 = {
name: 'xujian',
school: 'HNU'
};
var student2 = Object.create(student1, {
name: {
value: 'huangjing'
}
});
function object(o) {
function F() {}
F.prototype = o;
return new F();
}
function creatAnother(original) {
var clone = object(original);
clone.sayHi = function() {
alert('Hi!');
};
return clone;
}
var student1 = {
school: 'HNU',
saySchool: function() {
return this.school;
}
};
var student2 = creatAnother(student1);
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有