js面向对象部分分为几个部分:
1.面向对象–封装
http://blog.csdn.net/github_34514750/article/details/51044272
2.面向对象–原型链
http://blog.csdn.net/github_34514750/article/details/51045708
3.面向对象–构造函数的继承
http://blog.csdn.net/github_34514750/article/details/51336839
4.本文介绍面向对象–非构造函数的继承
1.object()方法–其实就是prototype链实现
var Chinese = {
nation:'中国'
};
var Doctor ={
career:'医生'
}
function object(o) {
function F() {
}
F.prototype = o;
return new F();
}
var Doctor = object(Chinese);
Doctor.career = '医生';