/**
*
*/
if(typeof Object.beget !== 'function'){
Object.beget = function(o){
var F = function(){};
F.prototype = o;
return new F();
}
}
/*
*
*/
var foo = {
name : 'foo',
print: function(msg){
console.log(msg)
}
}
/*
*
*/
foo.print('hello')
/*
*
*/
var bar = Object.beget(foo);
bar.print('world');
04-24
508
03-17
950
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交