编辑代码

function object(o) {
    function F() { };
    F.prototype = o;
    return new F();
}

var person = {
    name: 'David',
    age: 36,
    hobbies: ['PC game', 'music', 'drawing']

};

var anotherPerson = object(person);
anotherPerson.name = 'Allen';
anotherPerson.hobbies.push('running');

console.log(person.hobbies);