var Person = {
name: '人类',
age: 100,
speak: function() {
console.log('我的名字是'+this.name+',年龄'+this.age)
}
}
var King = {
name: '海王',
age: 10000,
speak: function() {
console.log('@!#!¥!@¥!#!')
}
}
function Gold(props) {
props = props || {}
this.name = props.name || '上帝';
this.age = 0;
this.speak = function() {
console.log('!')
}
}
Gold.prototype.version = '0.1'
var me = new Object();
me.__proto__ = Person;
me = Object.create(King)
function Man(props) {
props = props || {}
Gold.call(this, props)
this.msg = props.msg
}
function F() {}
F.prototype = Gold.prototype;
Man.prototype = new F()
Man.prototype.constructor = Man
console.log(new Gold())
console.log(new Man({msg: '你好啊'}))
console