function Parent() {
this.color = ['pink', 'red'];
}function createAnother(o) {
// 获得当前对象的一个克隆
var another = new Object(o);
// 增强对象
o.sayHi = function() {
console.log('Hi');
}
// 返回对象
return another;
}
函数式编程
MMMHUHU
随时随地看视频慕课网APP
相关分类